Skip to content

Commit

Permalink
Release 7.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Nov 17, 2023
1 parent 09bf6a8 commit 89c12f0
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
20 changes: 10 additions & 10 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" })),
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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" }),
Expand Down Expand Up @@ -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" }),
Expand Down Expand Up @@ -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" }),
Expand Down Expand Up @@ -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" }),
Expand Down Expand Up @@ -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" }),
Expand Down Expand Up @@ -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" }),
Expand Down Expand Up @@ -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" }),
Expand Down Expand Up @@ -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" }),
Expand Down
5 changes: 1 addition & 4 deletions src/api/types/ChatDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@
* passed to the model.
*
*/
export interface ChatDocument {
/** Unique identifier for this document. */
id?: string;
}
export type ChatDocument = Record<string, string>;
2 changes: 1 addition & 1 deletion src/serialization/client/requests/ChatRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ChatRequest: core.serialization.Schema<serializers.ChatRequest.Raw,
.optional(),
searchQueriesOnly: core.serialization.property("search_queries_only", core.serialization.boolean().optional()),
documents: core.serialization
.list(core.serialization.lazyObject(async () => (await import("../..")).ChatDocument))
.list(core.serialization.lazy(async () => (await import("../..")).ChatDocument))
.optional(),
citationQuality: core.serialization.property(
"citation_quality",
Expand Down
2 changes: 1 addition & 1 deletion src/serialization/client/requests/ChatStreamRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ChatStreamRequest: core.serialization.Schema<serializers.ChatStream
.optional(),
searchQueriesOnly: core.serialization.property("search_queries_only", core.serialization.boolean().optional()),
documents: core.serialization
.list(core.serialization.lazyObject(async () => (await import("../..")).ChatDocument))
.list(core.serialization.lazy(async () => (await import("../..")).ChatDocument))
.optional(),
citationQuality: core.serialization.property(
"citation_quality",
Expand Down
10 changes: 3 additions & 7 deletions src/serialization/types/ChatDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ import * as serializers from "..";
import * as Cohere from "../../api";
import * as core from "../../core";

export const ChatDocument: core.serialization.ObjectSchema<serializers.ChatDocument.Raw, Cohere.ChatDocument> =
core.serialization.object({
id: core.serialization.string().optional(),
});
export const ChatDocument: core.serialization.Schema<serializers.ChatDocument.Raw, Cohere.ChatDocument> =
core.serialization.record(core.serialization.string(), core.serialization.string());

export declare namespace ChatDocument {
interface Raw {
id?: string | null;
}
type Raw = Record<string, string>;
}
4 changes: 1 addition & 3 deletions src/serialization/types/ChatSearchResultsEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion src/serialization/types/NonStreamedChatResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 89c12f0

Please sign in to comment.