Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ai-sdk/cohere

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/cohere - npm Package Compare versions

Comparing version 0.0.22 to 0.0.23

18

./dist/index.js

@@ -225,2 +225,3 @@ "use strict";

async doGenerate(options) {
var _a;
const args = this.getArgs(options);

@@ -260,2 +261,5 @@ const { responseHeaders, value: response } = await (0, import_provider_utils2.postJsonToApi)({

},
response: {
id: (_a = response.generation_id) != null ? _a : void 0
},
rawResponse: { headers: responseHeaders },

@@ -293,2 +297,3 @@ warnings: void 0

transform(chunk, controller) {
var _a;
if (!chunk.success) {

@@ -353,2 +358,9 @@ finishReason = "error";

}
case "stream-start": {
controller.enqueue({
type: "response-metadata",
id: (_a = value.generation_id) != null ? _a : void 0
});
return;
}
case "stream-end": {

@@ -389,2 +401,3 @@ finishReason = mapCohereFinishReason(value.finish_reason);

var cohereChatResponseSchema = import_zod2.z.object({
generation_id: import_zod2.z.string().nullish(),
text: import_zod2.z.string(),

@@ -396,3 +409,3 @@ tool_calls: import_zod2.z.array(

})
).optional(),
).nullish(),
finish_reason: import_zod2.z.string(),

@@ -408,3 +421,4 @@ meta: import_zod2.z.object({

import_zod2.z.object({
event_type: import_zod2.z.literal("stream-start")
event_type: import_zod2.z.literal("stream-start"),
generation_id: import_zod2.z.string().nullish()
}),

@@ -411,0 +425,0 @@ import_zod2.z.object({

# @ai-sdk/cohere
## 0.0.23
### Patch Changes
- 03313cd: feat (ai): expose response id, response model, response timestamp in telemetry and api
- Updated dependencies [03313cd]
- Updated dependencies [3be7c1c]
- @ai-sdk/provider-utils@1.0.18
- @ai-sdk/provider@0.0.23
## 0.0.22

@@ -4,0 +14,0 @@

@@ -225,2 +225,3 @@ "use strict";

async doGenerate(options) {
var _a;
const args = this.getArgs(options);

@@ -260,2 +261,5 @@ const { responseHeaders, value: response } = await (0, import_provider_utils2.postJsonToApi)({

},
response: {
id: (_a = response.generation_id) != null ? _a : void 0
},
rawResponse: { headers: responseHeaders },

@@ -293,2 +297,3 @@ warnings: void 0

transform(chunk, controller) {
var _a;
if (!chunk.success) {

@@ -353,2 +358,9 @@ finishReason = "error";

}
case "stream-start": {
controller.enqueue({
type: "response-metadata",
id: (_a = value.generation_id) != null ? _a : void 0
});
return;
}
case "stream-end": {

@@ -389,2 +401,3 @@ finishReason = mapCohereFinishReason(value.finish_reason);

var cohereChatResponseSchema = import_zod2.z.object({
generation_id: import_zod2.z.string().nullish(),
text: import_zod2.z.string(),

@@ -396,3 +409,3 @@ tool_calls: import_zod2.z.array(

})
).optional(),
).nullish(),
finish_reason: import_zod2.z.string(),

@@ -408,3 +421,4 @@ meta: import_zod2.z.object({

import_zod2.z.object({
event_type: import_zod2.z.literal("stream-start")
event_type: import_zod2.z.literal("stream-start"),
generation_id: import_zod2.z.string().nullish()
}),

@@ -411,0 +425,0 @@ import_zod2.z.object({

6

package.json
{
"name": "@ai-sdk/cohere",
"version": "0.0.22",
"version": "0.0.23",
"license": "Apache-2.0",

@@ -22,4 +22,4 @@ "sideEffects": false,

"dependencies": {
"@ai-sdk/provider": "0.0.22",
"@ai-sdk/provider-utils": "1.0.17"
"@ai-sdk/provider": "0.0.23",
"@ai-sdk/provider-utils": "1.0.18"
},

@@ -26,0 +26,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc