Skip to content

Commit

Permalink
🌿 Fern Regeneration -- September 19, 2024 (#203)
Browse files Browse the repository at this point in the history
* SDK regeneration

* Fix types

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Billy Trend <[email protected]>
  • Loading branch information
fern-api[bot] and billytrend-cohere authored Sep 19, 2024
1 parent 80d9420 commit 499bde5
Show file tree
Hide file tree
Showing 186 changed files with 2,493 additions and 1,334 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.13.1",
"version": "7.13.2",
"private": false,
"repository": "https://github.com/cohere-ai/cohere-typescript",
"main": "./index.js",
Expand Down
156 changes: 145 additions & 11 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ await client.checkApiKey();

## V2

<details><summary><code>client.v2.<a href="/src/api/resources/v2/client/Client.ts">chatStream</a>({ ...params }) -> core.Stream<Cohere.StreamedChatResponse2></code></summary>
<details><summary><code>client.v2.<a href="/src/api/resources/v2/client/Client.ts">chatStream</a>({ ...params }) -> core.Stream<Cohere.StreamedChatResponseV2></code></summary>
<dl>
<dd>

Expand Down Expand Up @@ -93,13 +93,6 @@ await client.v2.chatStream({
{
role: "user",
content: "string",
documents: [
{
string: {
key: "value",
},
},
],
},
],
tools: [
Expand All @@ -116,7 +109,10 @@ await client.v2.chatStream({
},
},
],
citationMode: Cohere.V2ChatStreamRequestCitationMode.Fast,
documents: ["string"],
citationOptions: {
mode: Cohere.CitationOptionsMode.Fast,
},
responseFormat: {
type: "text",
},
Expand Down Expand Up @@ -165,7 +161,7 @@ await client.v2.chatStream({
</dl>
</details>

<details><summary><code>client.v2.<a href="/src/api/resources/v2/client/Client.ts">chat</a>({ ...params }) -> Cohere.NonStreamedChatResponse2</code></summary>
<details><summary><code>client.v2.<a href="/src/api/resources/v2/client/Client.ts">chat</a>({ ...params }) -> Cohere.ChatResponse</code></summary>
<dl>
<dd>

Expand Down Expand Up @@ -199,7 +195,7 @@ await client.v2.chat({
{
role: "tool",
toolCallId: "messages",
toolContent: ["messages"],
toolContent: "messages",
},
],
});
Expand Down Expand Up @@ -237,6 +233,144 @@ await client.v2.chat({
</dl>
</details>

<details><summary><code>client.v2.<a href="/src/api/resources/v2/client/Client.ts">embed</a>({ ...params }) -> Cohere.EmbedByTypeResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.

Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.

If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search).

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.v2.embed({
inputType: "image",
images: ["string"],
model: "string",
});
```

</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `Cohere.EmbedRequestV2`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `V2.RequestOptions`

</dd>
</dl>
</dd>
</dl>

</dd>
</dl>
</details>

<details><summary><code>client.v2.<a href="/src/api/resources/v2/client/Client.ts">rerank</a>({ ...params }) -> Cohere.V2RerankResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.v2.rerank({
model: "model",
query: "query",
documents: ["documents"],
});
```

</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `Cohere.V2RerankRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `V2.RequestOptions`

</dd>
</dl>
</dd>
</dl>

</dd>
</dl>
</details>

## EmbedJobs

<details><summary><code>client.embedJobs.<a href="/src/api/resources/embedJobs/client/Client.ts">list</a>() -> Cohere.ListEmbedJobResponse</code></summary>
Expand Down
48 changes: 24 additions & 24 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class CohereClient {

/**
* Generates a text response to a user message.
* To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).
* To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).
*/
public async chatStream(
request: Cohere.ChatStreamRequest,
Expand All @@ -63,8 +63,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
Accepts: accepts != null ? accepts : undefined,
Expand Down Expand Up @@ -193,7 +193,7 @@ export class CohereClient {

/**
* Generates a text response to a user message.
* To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).
* To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).
*
* @param {Cohere.ChatRequest} request
* @param {CohereClient.RequestOptions} requestOptions - Request-specific configuration.
Expand Down Expand Up @@ -241,8 +241,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
Accepts: accepts != null ? accepts : undefined,
Expand Down Expand Up @@ -382,8 +382,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -553,8 +553,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -712,8 +712,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -867,8 +867,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -1022,8 +1022,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -1179,8 +1179,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -1334,8 +1334,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -1489,8 +1489,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -1637,8 +1637,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.13.1",
"User-Agent": "cohere-ai/7.13.1",
"X-Fern-SDK-Version": "7.13.2",
"User-Agent": "cohere-ai/7.13.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
6 changes: 3 additions & 3 deletions src/ClientV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { V2 } from "./api/resources/v2/client/Client";
import { CohereClient } from "./Client";

// this class will require manual updates over time
export class CohereClientV2 implements Omit<CohereClient, "chat" | "chatStream" | "v2">, Pick<V2, keyof V2> {
export class CohereClientV2 implements Omit<CohereClient, keyof V2 | "v2">, Pick<V2, keyof V2> {
constructor(private _options: CohereClient.Options) {
}

Expand All @@ -11,11 +11,11 @@ export class CohereClientV2 implements Omit<CohereClient, "chat" | "chatStream"

chat = this.clientV2.chat.bind(this.clientV2)
chatStream = this.clientV2.chatStream.bind(this.clientV2)
embed = this.clientV2.embed.bind(this.clientV2)
rerank = this.clientV2.rerank.bind(this.clientV2)

generateStream = this.client.generateStream.bind(this.clientV2)
generate = this.client.generate.bind(this.clientV2)
embed = this.client.embed.bind(this.clientV2)
rerank = this.client.rerank.bind(this.clientV2)
classify = this.client.classify.bind(this.clientV2)
summarize = this.client.summarize.bind(this.clientV2)
tokenize = this.client.tokenize.bind(this.clientV2)
Expand Down
Loading

0 comments on commit 499bde5

Please sign in to comment.