/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmPromptsCreate } from "../funcs/llmPromptsCreate.js"; import { llmPromptsCreateVersion } from "../funcs/llmPromptsCreateVersion.js"; import { llmPromptsDelete } from "../funcs/llmPromptsDelete.js"; import { llmPromptsGet } from "../funcs/llmPromptsGet.js"; import { llmPromptsGetVersion } from "../funcs/llmPromptsGetVersion.js"; import { llmPromptsList } from "../funcs/llmPromptsList.js"; import { llmPromptsListVersions } from "../funcs/llmPromptsListVersions.js"; import { llmPromptsRollback } from "../funcs/llmPromptsRollback.js"; import { llmPromptsUpdate } from "../funcs/llmPromptsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Prompts extends ClientSDK { /** * Create a prompt * * @remarks * Creates a new prompt with its first version. The template supports {{variable}} placeholders. */ async create( request: operations.CreatePromptRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsCreate( this, request, options, )); } /** * List prompts * * @remarks * Returns a paginated list of prompts owned by the authenticated user. */ async list( request: operations.ListPromptsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsList( this, request, options, )); } /** * Get a prompt * * @remarks * Retrieves a prompt by its ID, including the active template. Pass `version` to get a specific version's template. Pass `variables` as a JSON-encoded map to render the template with substitutions. */ async get( request: operations.GetPromptRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsGet( this, request, options, )); } /** * Update a prompt * * @remarks * Updates prompt metadata. To update the template content, create a new version instead. */ async update( request: operations.UpdatePromptRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsUpdate( this, request, options, )); } /** * Delete a prompt * * @remarks * Deletes a prompt and all its versions. */ async delete( request: operations.DeletePromptRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsDelete( this, request, options, )); } /** * Create a new version * * @remarks * Creates a new version of a prompt. The new version automatically becomes the active version. Fields not provided are carried forward from the previous version. */ async createVersion( request: operations.CreatePromptVersionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsCreateVersion( this, request, options, )); } /** * List versions * * @remarks * Returns the version history of a prompt, ordered by version number. */ async listVersions( request: operations.ListPromptVersionsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsListVersions( this, request, options, )); } /** * Get a specific version * * @remarks * Retrieves a specific version of a prompt by version number. */ async getVersion( request: operations.GetPromptVersionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsGetVersion( this, request, options, )); } /** * Rollback to a version * * @remarks * Sets the active version of a prompt to a previous version. This does not delete newer versions — it only changes which version is active. */ async rollback( request: operations.RollbackPromptRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmPromptsRollback( this, request, options, )); } }