Runner to see the model’s answer in your terminal
Prerequisites
- Complete the installation and activate the Python environment containing VeADK
- Obtain a Volcengine Ark or BytePlus ModelArk API key with permission to call your chosen model
- The environment variable examples use Bash or zsh. Configure and run the example in the same terminal
Configure a model
Select the platform hosting your model. Use an API key issued by that platform and replace the model name with one available to your account- Volcengine
- BytePlus
Prepare an API key and an available model in the Ark console, then set:
MODEL_AGENT_PROVIDER=openai selects the OpenAI-compatible protocol. Requests go to the platform address in MODEL_AGENT_API_BASE. This example sets the model, address, and credentials explicitly so it does not depend on version-specific defaults
Create and run an agent
Createmain.py in your project directory:
main.py
Agent defines the model, instructions, and tools. Runner executes the conversation. Here, Agent() uses the model configuration set earlier, and runner.run(...) returns the response text
Run the script from the directory containing main.py:
Optional: Use a configuration file
To reuse nonsensitive model settings, createconfig.yaml beside main.py. This example configures Volcengine Ark; continue supplying the API key through the environment:
config.yaml
config.yaml from the current working directory upward. Existing environment variables take precedence over matching file settings. Editing the file does not override model settings exported earlier. See Models for additional options