Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect initialization syntax for ChatOpenAI in DOC: <Issue related to /v0.2/docs/tutorials/chatbot> #5904

Closed
2 tasks done
enodi opened this issue Jun 26, 2024 · 1 comment · Fixed by #5911
Closed
2 tasks done
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder

Comments

@enodi
Copy link

enodi commented Jun 26, 2024

Checklist

  • I added a very descriptive title to this issue.
  • I included a link to the documentation page I am referring to (if applicable).

Issue with current documentation:

The current documentation on LangChain(Link: https://js.langchain.com/v0.2/docs/tutorials/chatbot#quickstart) for initializing the ChatOpenAI instance contains an error in the syntax. The provided example uses: const model = new ChatOpenAI(model="gpt-3.5-turbo");, which leads to a ReferenceError. Instead, it should be using an object to pass the configuration parameter, like this: const model = new ChatOpenAI({ model: "gpt-3.5-turbo" });.

Idea or request for content:

To improve the documentation, I suggest updating the example to use the correct syntax: const model = new ChatOpenAI({ model: "gpt-3.5-turbo" });

@dosubot dosubot bot added the auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder label Jun 26, 2024
Copy link

dosubot bot commented Jun 26, 2024

Hey @enodi! 👋 I'm here to help you with bugs, questions, and becoming a contributor. If you need anything, just let me know!

The correct initialization syntax for the ChatOpenAI instance should indeed use an object to pass the configuration parameter. The example should be updated from:

const model = new ChatOpenAI(model="gpt-3.5-turbo");

to:

const model = new ChatOpenAI({ model: "gpt-3.5-turbo" });

This change will prevent a ReferenceError and ensure the correct initialization of the ChatOpenAI instance [1][2].

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant