@langchain/openai
Advanced tools
Comparing version
@@ -116,3 +116,8 @@ import { AzureOpenAI as AzureOpenAIClient, } from "openai"; | ||
try { | ||
const res = await this.client.embeddings.create(request, requestOptions); | ||
const res = await this.client.embeddings.create(request, | ||
// This unknown cast is required because OpenAI types seem to be incorrect here | ||
// without it, we can't pass arbitrary keys via the `query` field in the options, | ||
// which means we can't specify the `api-version` as required by Azure OpenAI. | ||
// See https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning | ||
requestOptions); | ||
return res; | ||
@@ -119,0 +124,0 @@ } |
import type { OpenAI as OpenAIClient } from "openai"; | ||
import type { RequestOptions as _OpenAICoreRequestOptions } from "openai/core"; | ||
import type { ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema } from "openai/resources/shared"; | ||
@@ -76,14 +77,3 @@ import { TiktokenModel } from "js-tiktoken/lite"; | ||
} | ||
export type OpenAICoreRequestOptions<Req extends object = Record<string, unknown>> = { | ||
path?: string; | ||
query?: Req | undefined; | ||
body?: Req | undefined; | ||
headers?: Record<string, string | null | undefined> | undefined; | ||
maxRetries?: number; | ||
stream?: boolean | undefined; | ||
timeout?: number; | ||
httpAgent?: any; | ||
signal?: AbortSignal | undefined | null; | ||
idempotencyKey?: string; | ||
}; | ||
export type OpenAICoreRequestOptions<Req = Record<string, unknown>> = _OpenAICoreRequestOptions<Req>; | ||
export interface OpenAICallOptions extends BaseLanguageModelCallOptions { | ||
@@ -90,0 +80,0 @@ /** |
{ | ||
"name": "@langchain/openai", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"description": "OpenAI integrations for LangChain.js", | ||
@@ -39,3 +39,3 @@ "type": "module", | ||
"js-tiktoken": "^1.0.12", | ||
"openai": "^4.87.3", | ||
"openai": "^4.93.0", | ||
"zod": "^3.22.4", | ||
@@ -66,3 +66,3 @@ "zod-to-json-schema": "^3.22.3" | ||
"prettier": "^2.8.3", | ||
"release-it": "^17.6.0", | ||
"release-it": "^18.1.2", | ||
"rimraf": "^5.0.1", | ||
@@ -69,0 +69,0 @@ "ts-jest": "^29.1.0", |
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 too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
396796
0.11%10808
0.04%0
-100%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated