langchain-ai / langsmith-sdk

LangSmith Client SDK Implementations
https://docs.smith.langchain.com/
MIT License
412 stars 79 forks source link

Issue: 400 Unsupported parameter: 'max_tokens' using model 'o1-preview' #1003

Open Prem95 opened 1 month ago

Prem95 commented 1 month ago

Issue you'd like to raise.

Changed the model in Playground to use o1-preview (I have Tier 5 support) but received this error instead

400 Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.

Error: 400 Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.
    at APIError.generate (file:///node_modules/openai/error.mjs:41:20)
    at OpenAI.makeStatusError (file:///node_modules/openai/core.mjs:268:25)
    at OpenAI.makeRequest (file:///node_modules/openai/core.mjs:311:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///node_modules/@langchain/openai/dist/chat_models.js:881:29
    at async RetryOperation._fn (/node_modules/p-retry/index.js:50:12)

Suggestion:

Support for new model from OpenAI

dennisofficial commented 1 month ago

For me, I'm just not getting any traces from o1-preview

hinthornw commented 1 month ago

@dennisofficial do you have code to share for that?