Open jmoseley opened 1 month ago
For the JS SDK, I believe that the wrapOpenAI helper is failing to expose anything except parse on the beta chat completions resource.
wrapOpenAI
parse
The problem may have been introduced in this change, as it only happens after version 0.1.62.
This crops up as this error:
TypeError: openai.beta.chat.completions.runTools is not a function
I logged the resources and noticed that openai.beta.chat.completions is an object that only has parse as a member.
openai.beta.chat.completions
// console.log('wat', { openai, "oepnai.beta": openai?.beta, "openai.beta.chat": openai?.beta?.chat, "openai.beta.chat.completions": openai?.beta?.chat?.completions, "openai.beta.chat.completions.runTools": openai?.beta?.chat?.completions?.runTools }) wat { openai: { baseURL: 'https://api.openai.com/v1', maxRetries: 2, timeout: 600000, httpAgent: undefined, fetch: <ref *1> [Function: fetch] { isRedirect: [Function (anonymous)], Promise: [Function: Promise], default: [Circular *1], Headers: [class Headers], Request: [class Request], Response: [class Response], FetchError: [Function: FetchError], AbortError: [Function: AbortError] }, completions: { _client: [OpenAI], create: [Function: traceableFunc] }, chat: { _client: [OpenAI], completions: [Object] }, embeddings: Embeddings { _client: [OpenAI] }, files: Files { _client: [OpenAI] }, images: Images { _client: [OpenAI] }, audio: Audio { _client: [OpenAI], transcriptions: [Transcriptions], translations: [Translations], speech: [Speech] }, moderations: Moderations { _client: [OpenAI] }, models: Models { _client: [OpenAI] }, fineTuning: FineTuning { _client: [OpenAI], jobs: [Jobs] }, beta: { _client: [OpenAI], vectorStores: [VectorStores], chat: [Object], assistants: [Assistants], threads: [Threads] }, batches: Batches { _client: [OpenAI] }, uploads: Uploads { _client: [OpenAI], parts: [Parts] }, _options: { apiKey: '[secret]', organization: null, project: null, baseURL: 'https://api.openai.com/v1' }, apiKey: '[secret]', organization: null, project: null }, "openai.beta": { _client: OpenAI { baseURL: 'https://api.openai.com/v1', maxRetries: 2, timeout: 600000, httpAgent: undefined, fetch: [Function], completions: [Completions], chat: [Chat], embeddings: [Embeddings], files: [Files], images: [Images], audio: [Audio], moderations: [Moderations], models: [Models], fineTuning: [FineTuning], beta: [Beta], batches: [Batches], uploads: [Uploads], _options: [Object], apiKey: '[secret]', organization: null, project: null }, vectorStores: VectorStores { _client: [OpenAI], files: [Files], fileBatches: [FileBatches] }, chat: { _client: [OpenAI], completions: [Object] }, assistants: Assistants { _client: [OpenAI] }, threads: Threads { _client: [OpenAI], runs: [Runs], messages: [Messages] } }, "openai.beta.chat": { _client: OpenAI { baseURL: 'https://api.openai.com/v1', maxRetries: 2, timeout: 600000, httpAgent: undefined, fetch: [Function], completions: [Completions], chat: [Chat], embeddings: [Embeddings], files: [Files], images: [Images], audio: [Audio], moderations: [Moderations], models: [Models], fineTuning: [FineTuning], beta: [Beta], batches: [Batches], uploads: [Uploads], _options: [Object], apiKey: '[secret]', organization: null, project: null }, completions: { _client: [OpenAI], parse: [Function: traceableFunc] } }, "openai.beta.chat.completions": { _client: OpenAI { baseURL: 'https://api.openai.com/v1', maxRetries: 2, timeout: 600000, httpAgent: undefined, fetch: [Function], completions: [Completions], chat: [Chat], embeddings: [Embeddings], files: [Files], images: [Images], audio: [Audio], moderations: [Moderations], models: [Models], fineTuning: [FineTuning], beta: [Beta], batches: [Batches], uploads: [Uploads], _options: [Object], apiKey: '[secret]', organization: null, project: null }, parse: [Function: traceableFunc] }, "openai.beta.chat.completions.runTools": undefined }
No response
Hey @jmoseley, having a look at this! Thanks for reporting!
I tried downgrading to langsmith@0.1.62, and it worked!
langsmith@0.1.62
Issue you'd like to raise.
For the JS SDK, I believe that the
wrapOpenAI
helper is failing to expose anything exceptparse
on the beta chat completions resource.The problem may have been introduced in this change, as it only happens after version 0.1.62.
This crops up as this error:
I logged the resources and noticed that
openai.beta.chat.completions
is an object that only hasparse
as a member.Suggestion:
No response