mirror of
https://github.com/katanemo/plano.git
synced 2026-06-29 15:49:40 +02:00
Clean up dead demos and restructure directory layout
Phase 1 - Remove dead/duplicate content:
- Delete demos/samples_java/ (incomplete Java demo)
- Delete demos/shared/chatbot_ui/ (replaced by AnythingLLM)
- Delete demos/shared/grafana/, prometheus/, logfire/, honeycomb/, signoz/
(legacy observability stacks; only jaeger is retained)
- Delete variant docker-compose files (honeycomb, logfire, signoz, jaeger)
- Delete demos/use_cases/spotify_bearer_auth/run_demo.sh (stale script)
Phase 2 - Restructure into semantic categories:
- getting_started/ : weather_forecast, llm_gateway
- agent_orchestration/ : travel_agents, multi_agent_crewai_langchain
- llm_routing/ : model_alias_routing, preference_based_routing, claude_code_router
- filter_chains/ : http_filter, mcp_filter
- integrations/ : ollama, spotify_bearer_auth
- advanced/ : model_choice_test_harness, multi_turn_rag,
currency_exchange, stock_quote
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9c4b2fc570
commit
78f761ef75
183 changed files with 0 additions and 4879 deletions
3
demos/integrations/ollama/README.md
Normal file
3
demos/integrations/ollama/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
This demo shows how you can use ollama as upstream LLM.
|
||||
|
||||
Before you can start the demo please make sure you have ollama up and running. You can use command `ollama run llama3.2` to start llama 3.2 (3b) model locally at port `11434`.
|
||||
48
demos/integrations/ollama/config.yaml
Normal file
48
demos/integrations/ollama/config.yaml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
version: v0.1.0
|
||||
|
||||
listeners:
|
||||
egress_traffic:
|
||||
address: 0.0.0.0
|
||||
port: 12000
|
||||
message_format: openai
|
||||
timeout: 30s
|
||||
|
||||
llm_providers:
|
||||
|
||||
- model: my_llm_provider/llama3.2
|
||||
provider_interface: openai
|
||||
base_url: http://host.docker.internal:11434
|
||||
default: true
|
||||
|
||||
system_prompt: |
|
||||
You are a helpful assistant.
|
||||
|
||||
prompt_targets:
|
||||
- name: currency_exchange
|
||||
description: Get currency exchange rate from USD to other currencies
|
||||
parameters:
|
||||
- name: currency_symbol
|
||||
description: the currency that needs conversion
|
||||
required: true
|
||||
type: str
|
||||
in_path: true
|
||||
endpoint:
|
||||
name: frankfurther_api
|
||||
path: /v1/latest?base=USD&symbols={currency_symbol}
|
||||
system_prompt: |
|
||||
You are a helpful assistant. Show me the currency symbol you want to convert from USD.
|
||||
|
||||
- name: get_supported_currencies
|
||||
description: Get list of supported currencies for conversion
|
||||
endpoint:
|
||||
name: frankfurther_api
|
||||
path: /v1/currencies
|
||||
|
||||
endpoints:
|
||||
frankfurther_api:
|
||||
endpoint: api.frankfurter.dev:443
|
||||
protocol: https
|
||||
|
||||
tracing:
|
||||
random_sampling: 100
|
||||
trace_arch_internal: true
|
||||
21
demos/integrations/ollama/docker-compose.yaml
Normal file
21
demos/integrations/ollama/docker-compose.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
services:
|
||||
chatbot_ui:
|
||||
build:
|
||||
context: ../../shared/chatbot_ui
|
||||
ports:
|
||||
- "18080:8080"
|
||||
environment:
|
||||
# this is only because we are running the sample app in the same docker container environemtn as archgw
|
||||
- CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:12000/v1
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
volumes:
|
||||
- ./config.yaml:/app/plano_config.yaml
|
||||
|
||||
jaeger:
|
||||
build:
|
||||
context: ../../shared/jaeger
|
||||
ports:
|
||||
- "16686:16686"
|
||||
- "4317:4317"
|
||||
- "4318:4318"
|
||||
47
demos/integrations/ollama/run_demo.sh
Normal file
47
demos/integrations/ollama/run_demo.sh
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Function to start the demo
|
||||
start_demo() {
|
||||
# Step 1: Check if .env file exists
|
||||
if [ -f ".env" ]; then
|
||||
echo ".env file already exists. Skipping creation."
|
||||
else
|
||||
# Step 2: Create `.env` file and set OpenAI key
|
||||
if [ -z "$OPENAI_API_KEY" ]; then
|
||||
echo "Error: OPENAI_API_KEY environment variable is not set for the demo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Creating .env file..."
|
||||
echo "OPENAI_API_KEY=$OPENAI_API_KEY" > .env
|
||||
echo ".env file created with OPENAI_API_KEY."
|
||||
fi
|
||||
|
||||
# Step 3: Start Plano
|
||||
echo "Starting Plano with config.yaml..."
|
||||
planoai up config.yaml
|
||||
|
||||
# Step 4: Start developer services
|
||||
echo "Starting Network Agent using Docker Compose..."
|
||||
docker compose up -d # Run in detached mode
|
||||
}
|
||||
|
||||
# Function to stop the demo
|
||||
stop_demo() {
|
||||
# Step 1: Stop Docker Compose services
|
||||
echo "Stopping Network Agent using Docker Compose..."
|
||||
docker compose down
|
||||
|
||||
# Step 2: Stop Plano
|
||||
echo "Stopping Plano..."
|
||||
planoai down
|
||||
}
|
||||
|
||||
# Main script logic
|
||||
if [ "$1" == "down" ]; then
|
||||
stop_demo
|
||||
else
|
||||
# Default action is to bring the demo up
|
||||
start_demo
|
||||
fi
|
||||
31
demos/integrations/spotify_bearer_auth/README.md
Normal file
31
demos/integrations/spotify_bearer_auth/README.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Use Case Demo: Bearer Authorization with Spotify APIs
|
||||
|
||||
In this demo, we show how you can use Plano's bearer authorization capability to connect your agentic apps to third-party APIs.
|
||||
More specifically, we demonstrate how you can connect to two Spotify APIs:
|
||||
|
||||
- [`/v1/browse/new-releases`](https://developer.spotify.com/documentation/web-api/reference/get-new-releases)
|
||||
- [`/v1/artists/{artist_id}/top-tracks`](https://developer.spotify.com/documentation/web-api/reference/get-an-artists-top-tracks)
|
||||
|
||||
Where users can engage by asking questions like _"Show me the latest releases in the US"_, followed by queries like _"Show me top tracks from Taylor Swift"_.
|
||||
|
||||

|
||||
|
||||
## Starting the demo
|
||||
|
||||
1. Ensure the [prerequisites](https://github.com/katanemo/arch/?tab=readme-ov-file#prerequisites) are installed correctly.
|
||||
2. Create an `.env` file with API keys for OpenAI and Spotify.
|
||||
- Sign up for an OpenAI API key at [https://platform.openai.com/signup/](https://platform.openai.com/signup/)
|
||||
- Sign up for a Spotify Client Key/Secret by following instructions at [https://developer.spotify.com/dashboard/](https://developer.spotify.com/dashboard/)
|
||||
- Generate a Spotify token using the [https://accounts.spotify.com/api/token API](https://accounts.spotify.com/api/token), using ```curl``` or similar commands.
|
||||
- Create a .env file with the following keys:
|
||||
```
|
||||
OPENAI_API_KEY=your_openai_api_key
|
||||
SPOTIFY_CLIENT_KEY=your_spotify_api_token
|
||||
```
|
||||
|
||||
3. Start Plano
|
||||
```sh
|
||||
sh run_demo.sh
|
||||
```
|
||||
4. Navigate to http://localhost:18080
|
||||
5. Ask "show me new album releases in the US"
|
||||
123
demos/integrations/spotify_bearer_auth/config.yaml
Normal file
123
demos/integrations/spotify_bearer_auth/config.yaml
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
version: v0.1.0
|
||||
|
||||
listeners:
|
||||
ingress_traffic:
|
||||
address: 0.0.0.0
|
||||
port: 10000
|
||||
message_format: openai
|
||||
timeout: 30s
|
||||
|
||||
overrides:
|
||||
optimize_context_window: true
|
||||
|
||||
endpoints:
|
||||
spotify:
|
||||
endpoint: api.spotify.com
|
||||
protocol: https
|
||||
|
||||
system_prompt: |
|
||||
I have the following JSON data representing a list of albums from Spotify:
|
||||
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"album_type": "album",
|
||||
"artists": [
|
||||
{
|
||||
"external_urls": {
|
||||
"spotify": "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"
|
||||
},
|
||||
"href": "https://api.spotify.com/v1/artists/06HL4z0CvFAxyc27GXpf02",
|
||||
"id": "06HL4z0CvFAxyc27GXpf02",
|
||||
"name": "Taylor Swift",
|
||||
"type": "artist",
|
||||
"uri": "spotify:artist:06HL4z0CvFAxyc27GXpf02"
|
||||
}
|
||||
],
|
||||
"available_markets": [ /* ... markets omitted for brevity ... */ ],
|
||||
"external_urls": {
|
||||
"spotify": "https://open.spotify.com/album/1Mo4aZ8pdj6L1jx8zSwJnt"
|
||||
},
|
||||
"href": "https://api.spotify.com/v1/albums/1Mo4aZ8pdj6L1jx8zSwJnt",
|
||||
"id": "1Mo4aZ8pdj6L1jx8zSwJnt",
|
||||
"images": [
|
||||
{
|
||||
"height": 300,
|
||||
"url": "https://i.scdn.co/image/ab67616d00001e025076e4160d018e378f488c33",
|
||||
"width": 300
|
||||
},
|
||||
{
|
||||
"height": 64,
|
||||
"url": "https://i.scdn.co/image/ab67616d000048515076e4160d018e378f488c33",
|
||||
"width": 64
|
||||
},
|
||||
{
|
||||
"height": 640,
|
||||
"url": "https://i.scdn.co/image/ab67616d0000b2735076e4160d018e378f488c33",
|
||||
"width": 640
|
||||
}
|
||||
],
|
||||
"name": "THE TORTURED POETS DEPARTMENT",
|
||||
"release_date": "2024-04-18",
|
||||
"release_date_precision": "day",
|
||||
"total_tracks": 16,
|
||||
"type": "album",
|
||||
"uri": "spotify:album:1Mo4aZ8pdj6L1jx8zSwJnt"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Please convert this JSON into Markdown with the following layout for each album:
|
||||
|
||||
- Display the album image (using Markdown image syntax) first.
|
||||
- On the next line immediately after the image, display the album title, artist name (use the first artist listed), and the release date, all separated by a hyphen or another clear delimiter.
|
||||
- On the next line, provide the Spotify link (using Markdown link syntax).
|
||||
|
||||
For example, the output should look similar to this (using the data above):
|
||||
|
||||

|
||||
**THE TORTURED POETS DEPARTMENT**
|
||||
Taylor Swift - 2024-04-18
|
||||
[Listen on Spotify](https://open.spotify.com/album/1Mo4aZ8pdj6L1jx8zSwJnt)
|
||||
Arist Id: 06HL4z0CvFAxyc27GXpf02
|
||||
<hr>
|
||||
|
||||
Make sure your output is valid Markdown. And don't say "formatted in Markdown". Thanks!
|
||||
|
||||
llm_providers:
|
||||
- access_key: $OPENAI_API_KEY
|
||||
model: openai/gpt-4o
|
||||
default: true
|
||||
|
||||
prompt_targets:
|
||||
- name: get_new_releases
|
||||
description: Get a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab).
|
||||
parameters:
|
||||
- name: country
|
||||
description: the country where the album is released
|
||||
required: true
|
||||
type: str
|
||||
in_path: true
|
||||
- name: limit
|
||||
type: integer
|
||||
description: The maximum number of results to return
|
||||
default: "5"
|
||||
endpoint:
|
||||
name: spotify
|
||||
path: /v1/browse/new-releases
|
||||
http_headers:
|
||||
Authorization: "Bearer $SPOTIFY_CLIENT_KEY"
|
||||
|
||||
- name: get_artist_top_tracks
|
||||
description: Get information about an artist's top tracks
|
||||
parameters:
|
||||
- name: artist_id
|
||||
description: The ID of the artist.
|
||||
required: true
|
||||
type: str
|
||||
in_path: true
|
||||
endpoint:
|
||||
name: spotify
|
||||
path: /v1/artists/{artist_id}/top-tracks
|
||||
http_headers:
|
||||
Authorization: "Bearer $SPOTIFY_CLIENT_KEY"
|
||||
21
demos/integrations/spotify_bearer_auth/docker-compose.yaml
Normal file
21
demos/integrations/spotify_bearer_auth/docker-compose.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
services:
|
||||
chatbot_ui:
|
||||
build:
|
||||
context: ../../shared/chatbot_ui
|
||||
ports:
|
||||
- "18080:8080"
|
||||
environment:
|
||||
# this is only because we are running the sample app in the same docker container environemtn as archgw
|
||||
- CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
volumes:
|
||||
- ./config.yaml:/app/plano_config.yaml
|
||||
|
||||
jaeger:
|
||||
build:
|
||||
context: ../../shared/jaeger
|
||||
ports:
|
||||
- "16686:16686"
|
||||
- "4317:4317"
|
||||
- "4318:4318"
|
||||
47
demos/integrations/spotify_bearer_auth/run_demo.sh
Normal file
47
demos/integrations/spotify_bearer_auth/run_demo.sh
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Function to start the demo
|
||||
start_demo() {
|
||||
# Step 1: Check if .env file exists
|
||||
if [ -f ".env" ]; then
|
||||
echo ".env file already exists. Skipping creation."
|
||||
else
|
||||
# Step 2: Create `.env` file and set OpenAI key
|
||||
if [ -z "$OPENAI_API_KEY" ]; then
|
||||
echo "Error: OPENAI_API_KEY environment variable is not set for the demo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Creating .env file..."
|
||||
echo "OPENAI_API_KEY=$OPENAI_API_KEY" > .env
|
||||
echo ".env file created with OPENAI_API_KEY."
|
||||
fi
|
||||
|
||||
# Step 3: Start Plano
|
||||
echo "Starting Plano with config.yaml..."
|
||||
planoai up config.yaml
|
||||
|
||||
# Step 4: Start developer services
|
||||
echo "Starting Network Agent using Docker Compose..."
|
||||
docker compose up -d # Run in detached mode
|
||||
}
|
||||
|
||||
# Function to stop the demo
|
||||
stop_demo() {
|
||||
# Step 1: Stop Docker Compose services
|
||||
echo "Stopping Network Agent using Docker Compose..."
|
||||
docker compose down
|
||||
|
||||
# Step 2: Stop Plano
|
||||
echo "Stopping Plano..."
|
||||
planoai down
|
||||
}
|
||||
|
||||
# Main script logic
|
||||
if [ "$1" == "down" ]; then
|
||||
stop_demo
|
||||
else
|
||||
# Default action is to bring the demo up
|
||||
start_demo
|
||||
fi
|
||||
BIN
demos/integrations/spotify_bearer_auth/spotify_bearer_auth.png
Normal file
BIN
demos/integrations/spotify_bearer_auth/spotify_bearer_auth.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1,012 KiB |
Loading…
Add table
Add a link
Reference in a new issue