diff --git a/package.json b/package.json index 39a5d23..51d9969 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cohere-ai", - "version": "7.3.0", + "version": "7.4.0", "private": false, "repository": "https://github.com/cohere-ai/cohere-typescript", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 368b1cf..e9016b2 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -44,7 +44,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, body: { ...(await serializers.ChatStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), @@ -87,7 +87,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: { @@ -148,7 +148,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.GenerateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -217,7 +217,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.EmbedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -280,7 +280,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.RerankRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -339,7 +339,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.ClassifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -402,7 +402,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.DetectLanguageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -458,7 +458,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.SummarizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -516,7 +516,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.TokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -579,7 +579,7 @@ export class CohereClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.3.0", + "X-Fern-SDK-Version": "7.4.0", }, contentType: "application/json", body: await serializers.DetokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), diff --git a/src/api/types/ChatDocument.ts b/src/api/types/ChatDocument.ts index 62d55e7..2adb94e 100644 --- a/src/api/types/ChatDocument.ts +++ b/src/api/types/ChatDocument.ts @@ -9,7 +9,4 @@ * passed to the model. * */ -export interface ChatDocument { - /** Unique identifier for this document. */ - id?: string; -} +export type ChatDocument = Record; diff --git a/src/serialization/client/requests/ChatRequest.ts b/src/serialization/client/requests/ChatRequest.ts index 797a2f0..e885eac 100644 --- a/src/serialization/client/requests/ChatRequest.ts +++ b/src/serialization/client/requests/ChatRequest.ts @@ -27,7 +27,7 @@ export const ChatRequest: core.serialization.Schema (await import("../..")).ChatDocument)) + .list(core.serialization.lazy(async () => (await import("../..")).ChatDocument)) .optional(), citationQuality: core.serialization.property( "citation_quality", diff --git a/src/serialization/client/requests/ChatStreamRequest.ts b/src/serialization/client/requests/ChatStreamRequest.ts index 226b491..4c72310 100644 --- a/src/serialization/client/requests/ChatStreamRequest.ts +++ b/src/serialization/client/requests/ChatStreamRequest.ts @@ -27,7 +27,7 @@ export const ChatStreamRequest: core.serialization.Schema (await import("../..")).ChatDocument)) + .list(core.serialization.lazy(async () => (await import("../..")).ChatDocument)) .optional(), citationQuality: core.serialization.property( "citation_quality", diff --git a/src/serialization/types/ChatDocument.ts b/src/serialization/types/ChatDocument.ts index de1dabc..e702352 100644 --- a/src/serialization/types/ChatDocument.ts +++ b/src/serialization/types/ChatDocument.ts @@ -6,13 +6,9 @@ import * as serializers from ".."; import * as Cohere from "../../api"; import * as core from "../../core"; -export const ChatDocument: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string().optional(), - }); +export const ChatDocument: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.string()); export declare namespace ChatDocument { - interface Raw { - id?: string | null; - } + type Raw = Record; } diff --git a/src/serialization/types/ChatSearchResultsEvent.ts b/src/serialization/types/ChatSearchResultsEvent.ts index ea97a2b..2ae866d 100644 --- a/src/serialization/types/ChatSearchResultsEvent.ts +++ b/src/serialization/types/ChatSearchResultsEvent.ts @@ -15,9 +15,7 @@ export const ChatSearchResultsEvent: core.serialization.ObjectSchema< "search_results", core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).ChatSearchResult)) ), - documents: core.serialization.list( - core.serialization.lazyObject(async () => (await import("..")).ChatDocument) - ), + documents: core.serialization.list(core.serialization.lazy(async () => (await import("..")).ChatDocument)), }) .extend(core.serialization.lazyObject(async () => (await import("..")).ChatStreamEvent)); diff --git a/src/serialization/types/NonStreamedChatResponse.ts b/src/serialization/types/NonStreamedChatResponse.ts index ddc3c6d..1888363 100644 --- a/src/serialization/types/NonStreamedChatResponse.ts +++ b/src/serialization/types/NonStreamedChatResponse.ts @@ -16,7 +16,7 @@ export const NonStreamedChatResponse: core.serialization.ObjectSchema< .list(core.serialization.lazyObject(async () => (await import("..")).ChatCitation)) .optional(), documents: core.serialization - .list(core.serialization.lazyObject(async () => (await import("..")).ChatDocument)) + .list(core.serialization.lazy(async () => (await import("..")).ChatDocument)) .optional(), searchQueries: core.serialization.property( "search_queries",