Getting started
Installation
First, Yuan2.0 provided an OpenAI compatible API, and we integrate ChatYuan2 into langchain chat model by using OpenAI client. Therefore, ensure the openai package is installed in your Python environment. Run the following command:Importing the Required Modules
After installation, import the necessary modules to your Python script:Setting Up Your API server
Setting up your OpenAI compatible API server following yuan2 openai api server. If you deployed api server locally, you can simply setyuan2_api_key="EMPTY"
or anything you want.
Just make sure, the yuan2_api_base
is set correctly.