-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy pathcustom_provider.yaml
More file actions
36 lines (30 loc) · 1.28 KB
/
custom_provider.yaml
File metadata and controls
36 lines (30 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Example: Custom Provider Configuration
#
# This example demonstrates how to define and use custom providers in Cagent.
# Custom providers allow you to connect to OpenAI-compatible APIs with reusable
# configuration for base URLs, API tokens, and API schema types.
# Define custom providers with reusable configuration
providers:
# Example: Cloudflare AI Gateway with custom headers
cloudflare_gateway:
api_type: openai_chatcompletions
base_url: https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/compat
token_key: GOOGLE_API_KEY # Standard Authorization header for provider auth
headers:
# Custom header for gateway authentication with environment variable expansion
cf-aig-authorization: Bearer ${CLOUDFLARE_AI_GATEWAY_TOKEN}
# Define models that use the custom providers
models:
# Model using Cloudflare AI Gateway with custom headers
gemini_via_cloudflare:
provider: cloudflare_gateway
model: google-ai-studio/gemini-3-flash-preview
max_tokens: 8000
temperature: 0.7
# Define agents that use the models
agents:
root:
model: gemini_via_cloudflare
description: Main assistant using the custom gateway
instruction: |
You are a helpful AI assistant. Be concise and helpful in your responses.