OpenAI
Connecting
The default client for connecting to Arcade is the OpenAI Client. To send a chat message to OpenAI through Arcade, you can use the OpenAI Client as normal, while swapping out the base URL and API Key with Arcade's URL and API Key.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.arcade-ai.com/v1",
api_key=os.environ.get("ARCADE_API_KEY"))
response = client.chat.completions.create(
model = "gpt-3.5-turbo",
user = "[email protected]",
messages = [
{"role": "user", "content": "Summarize my last 10 emails"}
]
)
Configuration
This is a simple example on enabling OpenAI in the Arcade Engine
llm:
models:
- id: openai
openai:
api_key: <OPENAI API KEY>
For more advanced configuration, see the model docs