Skip to content
Draft
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@corti/sdk",
"version": "0.9.0",
"version": "0.10.0-rc.2",
"private": false,
"repository": "github:corticph/corti-sdk-javascript",
"license": "MIT",
Expand Down
13 changes: 11 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Transcripts } from "./api/resources/transcripts/client/Client.js";
import { Facts } from "./api/resources/facts/client/Client.js";
import { Documents } from "./api/resources/documents/client/Client.js";
import { Templates } from "./api/resources/templates/client/Client.js";
import { Codes } from "./api/resources/codes/client/Client.js";
import { Agents } from "./api/resources/agents/client/Client.js";
import { Stream } from "./api/resources/stream/client/Client.js";
import { Transcribe } from "./api/resources/transcribe/client/Client.js";
Expand Down Expand Up @@ -52,6 +53,7 @@ export class CortiClient {
protected _facts: Facts | undefined;
protected _documents: Documents | undefined;
protected _templates: Templates | undefined;
protected _codes: Codes | undefined;
protected _auth: Auth | undefined;
protected _agents: Agents | undefined;
protected _stream: Stream | undefined;
Expand All @@ -65,8 +67,8 @@ export class CortiClient {
"Tenant-Name": _options?.tenantName,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@corti/sdk",
"X-Fern-SDK-Version": "0.9.0",
"User-Agent": "@corti/sdk/0.9.0",
"X-Fern-SDK-Version": "0.10.0-rc.2",
"User-Agent": "@corti/sdk/0.10.0-rc.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -126,6 +128,13 @@ export class CortiClient {
}));
}

public get codes(): Codes {
return (this._codes ??= new Codes({
...this._options,
token: async () => await this._oauthTokenProvider.getToken(),
}));
}

public get auth(): Auth {
return (this._auth ??= new Auth({
...this._options,
Expand Down
19 changes: 19 additions & 0 deletions src/api/errors/BadGatewayError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors/index.js";
import * as Corti from "../index.js";
import * as core from "../../core/index.js";

export class BadGatewayError extends errors.CortiError {
constructor(body: Corti.ErrorResponse, rawResponse?: core.RawResponse) {
super({
message: "BadGatewayError",
statusCode: 502,
body: body,
rawResponse: rawResponse,
});
Object.setPrototypeOf(this, BadGatewayError.prototype);
}
}
1 change: 1 addition & 0 deletions src/api/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from "./BadRequestError.js";
export * from "./InternalServerError.js";
export * from "./NotFoundError.js";
export * from "./UnauthorizedError.js";
export * from "./BadGatewayError.js";
12 changes: 11 additions & 1 deletion src/api/resources/agents/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class Agents {
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -200,6 +201,7 @@ export class Agents {
}),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -288,6 +290,7 @@ export class Agents {
),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -372,6 +375,7 @@ export class Agents {
),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -467,6 +471,7 @@ export class Agents {
}),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -557,6 +562,7 @@ export class Agents {
),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -666,6 +672,7 @@ export class Agents {
}),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -769,6 +776,7 @@ export class Agents {
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -876,6 +884,7 @@ export class Agents {
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down Expand Up @@ -928,7 +937,7 @@ export class Agents {
}

/**
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsExpertReference schema.
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema.
*
* @param {Corti.AgentsGetRegistryExpertsRequest} request
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
Expand Down Expand Up @@ -981,6 +990,7 @@ export class Agents {
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down
2 changes: 2 additions & 0 deletions src/api/resources/agents/client/requests/AgentsCreateAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export interface AgentsCreateAgent {
ephemeral?: boolean | null;
/** The name of the agent. */
name: string;
/** Optional type of agent. */
agentType?: Corti.AgentsCreateAgentAgentType;
/** The system prompt that defines the overall agents behavior and expectations. This field is optional as there is a default system orchestrator. */
systemPrompt?: string;
/** A brief description of the agent's capabilities. */
Expand Down
13 changes: 13 additions & 0 deletions src/api/resources/agents/types/AgentsCreateAgentAgentType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

/**
* Optional type of agent.
*/
export type AgentsCreateAgentAgentType = "expert" | "orchestrator" | "interviewing-expert";
export const AgentsCreateAgentAgentType = {
Expert: "expert",
Orchestrator: "orchestrator",
InterviewingExpert: "interviewing-expert",
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

import * as Corti from "../../../index.js";

export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsExpertReference;
export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsCreateExpertReference;
1 change: 1 addition & 0 deletions src/api/resources/agents/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./AgentsCreateAgentAgentType.js";
export * from "./AgentsCreateAgentExpertsItem.js";
export * from "./AgentsMessageSendResponse.js";
1 change: 1 addition & 0 deletions src/api/resources/auth/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class Auth {
},
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
withCredentials: true,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
Expand Down
Loading
Loading