Skip to content

update typedoc #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,20 @@ type CreateAttachmentParams = {
metadata?: Maybe<Record<string, any>>;
};

/**
* 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;
Expand Down
16 changes: 15 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,21 @@ type StoredContext = {
};

const storage = new AsyncLocalStorage<StoredContext>();

/**
* 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<typeof openai>;
Expand Down
Loading