From 228eb0359191b3bc0488d19aebc4391a630b621b Mon Sep 17 00:00:00 2001 From: Dan Constantini Date: Wed, 21 Aug 2024 22:15:06 +0200 Subject: [PATCH 1/2] update typedoc --- src/api.ts | 14 ++++++++++++++ src/index.ts | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) 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..28ae7ed 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 client = new LiteralClient({ + * apiKey: 'your-api-key', + * environment: 'production' + * }); + * + * const thread = client.thread(); + * const step = client.step({ name: 'Example Step', type: 'llm' }); + * ``` + */ export class LiteralClient { api: API; openai: ReturnType; From 62ea509019647fd13e6f76f932c3ce0db4abbc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugues=20de=20Saxc=C3=A9?= Date: Wed, 28 Aug 2024 15:27:39 +0200 Subject: [PATCH 2/2] fix: naming --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 28ae7ed..89e985a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,13 +27,13 @@ const storage = new AsyncLocalStorage(); * * @example * ```typescript - * const client = new LiteralClient({ + * const literalAiClient = new LiteralClient({ * apiKey: 'your-api-key', * environment: 'production' * }); * - * const thread = client.thread(); - * const step = client.step({ name: 'Example Step', type: 'llm' }); + * const thread = literalAiClient.thread(); + * const step = literalAiClient.step({ name: 'Example Step', type: 'llm' }); * ``` */ export class LiteralClient {