Saltar para o conteúdo principal

The simplest way is to directly set environment variables as shown below

Download Address: https://www.langchain.com/
Note: Ensure to add /v1 at the end of openai_api_base,
Python
Example code for using LLM to make predictions
The core is actually in setting the key and URL
Methods include:
  1. Setting using environment variables
  2. Passing in variables
  3. Manually setting environment variables
Python
After running, você pode see the return:

Última atualização: 2026-06-01