diff --git a/src/api.ts b/src/api.ts index b409299..677a013 100644 --- a/src/api.ts +++ b/src/api.ts @@ -325,6 +325,20 @@ type CreateAttachmentParams = { metadata?: Maybe>; }; +/** + * Represents the API client for interacting with the Literal service. + * This class handles API requests, authentication, and provides methods + * for various operations supported by the Literal API. + * + * To use this API, you need to initialize a LiteralClient and access the API through it: + * + * ```typescript + * const literalAiClient = new LiteralClient({apiKey: process.env["LITERAL_API_KEY"]}); + * const api = literalAiClient.api; + * ``` + * + * Then you can use the `api` object to make calls to the Literal service. + */ export class API { /** @ignore */ public client: LiteralClient; diff --git a/src/index.ts b/src/index.ts index d1f8430..89e985a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,7 +21,21 @@ type StoredContext = { }; const storage = new AsyncLocalStorage(); - +/** + * The LiteralClient class provides an interface to interact with the Literal AI API. + * It offers methods for creating threads and steps, as well as instrumentation for various AI services. + * + * @example + * ```typescript + * const literalAiClient = new LiteralClient({ + * apiKey: 'your-api-key', + * environment: 'production' + * }); + * + * const thread = literalAiClient.thread(); + * const step = literalAiClient.step({ name: 'Example Step', type: 'llm' }); + * ``` + */ export class LiteralClient { api: API; openai: ReturnType;