mirror of
https://github.com/katanemo/plano.git
synced 2026-06-29 15:49:40 +02:00
fix demo
This commit is contained in:
parent
22a231024a
commit
14f72ad4f1
5 changed files with 36 additions and 63 deletions
|
|
@ -2,27 +2,23 @@ FROM python:3.13-slim
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install bash and uv
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && \
|
||||||
RUN pip install --no-cache-dir uv
|
apt-get install -y --no-install-recommends bash && \
|
||||||
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
pip install --no-cache-dir uv
|
||||||
|
|
||||||
# Copy dependency files
|
# Install Python dependencies
|
||||||
COPY pyproject.toml ./
|
COPY pyproject.toml README.md ./
|
||||||
COPY README.md ./
|
|
||||||
|
|
||||||
# Install dependencies to system Python
|
|
||||||
RUN uv pip install --system .
|
RUN uv pip install --system .
|
||||||
|
|
||||||
# Copy shared utilities
|
|
||||||
COPY openai_protocol.py ./
|
|
||||||
|
|
||||||
# Copy application code
|
# Copy application code
|
||||||
|
COPY openai_protocol.py ./
|
||||||
COPY crewai/ ./crewai/
|
COPY crewai/ ./crewai/
|
||||||
COPY langchain/ ./langchain/
|
COPY langchain/ ./langchain/
|
||||||
|
|
||||||
# Set environment variables
|
# Runtime configuration
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1 \
|
||||||
ENV PYTHONPATH=/app:$PYTHONPATH
|
PYTHONPATH=/app
|
||||||
|
|
||||||
# Default command (will be overridden in docker-compose)
|
|
||||||
CMD ["uv", "run", "python", "crewai/flight_agent.py"]
|
CMD ["uv", "run", "python", "crewai/flight_agent.py"]
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ version: v0.3.0
|
||||||
|
|
||||||
agents:
|
agents:
|
||||||
- id: weather_agent
|
- id: weather_agent
|
||||||
url: http://host.docker.internal:10510
|
url: http://langchain-weather-agent:10510
|
||||||
- id: flight_agent
|
- id: flight_agent
|
||||||
url: http://host.docker.internal:10520
|
url: http://crewai-flight-agent:10520
|
||||||
|
|
||||||
model_providers:
|
model_providers:
|
||||||
- model: openai/gpt-4o
|
- model: openai/gpt-4o
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ http_client = httpx.AsyncClient(timeout=30.0)
|
||||||
openai_client = AsyncOpenAI(base_url=LLM_GATEWAY_ENDPOINT, api_key="EMPTY")
|
openai_client = AsyncOpenAI(base_url=LLM_GATEWAY_ENDPOINT, api_key="EMPTY")
|
||||||
|
|
||||||
|
|
||||||
SYSTEM_PROMPT = """You are a travel planning assistant specializing in flight information.
|
SYSTEM_PROMPT = """You are a travel planning assistant specializing in flight information and travel conditions.
|
||||||
|
|
||||||
CRITICAL: You MUST respond with ONLY the final answer to the user.
|
CRITICAL: You MUST respond with ONLY the final answer to the user.
|
||||||
|
|
||||||
|
|
@ -60,12 +60,20 @@ Flight Information Format:
|
||||||
- Aircraft: Model name
|
- Aircraft: Model name
|
||||||
- Status: Current status
|
- Status: Current status
|
||||||
|
|
||||||
|
Weather Information (when available):
|
||||||
|
- Present weather data in a clear, readable format
|
||||||
|
- Include temperature, conditions, and any travel advisories
|
||||||
|
- Integrate weather context with flight information naturally
|
||||||
|
- Mention how weather might affect travel plans if relevant
|
||||||
|
|
||||||
Your task:
|
Your task:
|
||||||
1. Use tools silently (don't mention them to the user)
|
1. Use tools silently (don't mention them to the user)
|
||||||
2. Convert technical data into friendly, readable text
|
2. Convert technical data into friendly, readable text
|
||||||
3. Use 12-hour time format (e.g., "9:00 AM")
|
3. Use 12-hour time format (e.g., "9:00 AM")
|
||||||
4. Organize flights chronologically by departure time
|
4. Organize flights chronologically by departure time
|
||||||
5. Include terminal/gate info when available6. NOTE (Multi-agent context): If the conversation includes information from other sources that are not flight-related, incorporate it naturally."""
|
5. Include terminal/gate info when available
|
||||||
|
6. When weather data is provided, summarize it clearly and relate it to the travel plans
|
||||||
|
7. NOTE (Multi-agent context): If the conversation includes information from other sources (weather, hotels, etc.), incorporate it naturally and cohesively in your response."""
|
||||||
|
|
||||||
|
|
||||||
def build_flight_crew(
|
def build_flight_crew(
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
|
|
||||||
services:
|
services:
|
||||||
plano:
|
plano:
|
||||||
image: katanemo/plano:0.4.2 # Will auto-pull from Docker Hub if not present locally
|
build:
|
||||||
container_name: plano-dataplane
|
context: ../../../
|
||||||
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "12000:12000" # Main LLM gateway port
|
- "8001:8001"
|
||||||
- "8001:8001" # Agent/prompt gateway port
|
|
||||||
- "12001:12001" # Control plane port
|
|
||||||
- "19901:9901" # Envoy admin interface
|
|
||||||
environment:
|
environment:
|
||||||
- ARCH_CONFIG_PATH=/app/arch_config.yaml
|
- ARCH_CONFIG_PATH=/app/arch_config.yaml
|
||||||
- OPENAI_API_KEY=${OPENAI_API_KEY:?OPENAI_API_KEY environment variable is required but not set}
|
- OPENAI_API_KEY=${OPENAI_API_KEY:?OPENAI_API_KEY environment variable is required but not set}
|
||||||
|
|
@ -15,51 +13,28 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yaml:/app/arch_config.yaml:ro
|
- ./config.yaml:/app/arch_config.yaml:ro
|
||||||
- /etc/ssl/cert.pem:/etc/ssl/cert.pem
|
- /etc/ssl/cert.pem:/etc/ssl/cert.pem
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:12000/healthz"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 3s
|
|
||||||
retries: 5
|
|
||||||
start_period: 10s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
crewai-flight-agent:
|
crewai-flight-agent:
|
||||||
build:
|
build:
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: crewai-flight-agent
|
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "10520:10520"
|
- "10520:10520"
|
||||||
environment:
|
environment:
|
||||||
- LLM_GATEWAY_ENDPOINT=http://host.docker.internal:12000/v1
|
- LLM_GATEWAY_ENDPOINT=http://plano:12000/v1
|
||||||
- AEROAPI_KEY=${AEROAPI_KEY:?AEROAPI_KEY environment variable is required but not set}
|
- AEROAPI_KEY=${AEROAPI_KEY:?AEROAPI_KEY environment variable is required but not set}
|
||||||
- PYTHONUNBUFFERED=1
|
- PYTHONUNBUFFERED=1
|
||||||
command: ["python", "-u", "crewai/flight_agent.py"]
|
command: ["python", "-u", "crewai/flight_agent.py"]
|
||||||
depends_on:
|
|
||||||
plano:
|
|
||||||
condition: service_healthy
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
langchain-weather-agent:
|
langchain-weather-agent:
|
||||||
build:
|
build:
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: langchain-weather-agent
|
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "10510:10510"
|
- "10510:10510"
|
||||||
environment:
|
environment:
|
||||||
- LLM_GATEWAY_ENDPOINT=http://host.docker.internal:12000/v1
|
- LLM_GATEWAY_ENDPOINT=http://plano:12000/v1
|
||||||
- PYTHONUNBUFFERED=1
|
|
||||||
command: ["python", "-u", "langchain/weather_agent.py"]
|
command: ["python", "-u", "langchain/weather_agent.py"]
|
||||||
depends_on:
|
|
||||||
plano:
|
|
||||||
condition: service_healthy
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
open-web-ui:
|
open-web-ui:
|
||||||
image: dyrnq/open-webui:main
|
image: dyrnq/open-webui:main
|
||||||
|
|
@ -69,21 +44,11 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- DEFAULT_MODEL=gpt-4o-mini
|
- DEFAULT_MODEL=gpt-4o-mini
|
||||||
- ENABLE_OPENAI_API=true
|
- ENABLE_OPENAI_API=true
|
||||||
- OPENAI_API_BASE_URL=http://host.docker.internal:8001/v1
|
- OPENAI_API_BASE_URL=http://plano:8001/v1
|
||||||
depends_on:
|
|
||||||
plano:
|
|
||||||
condition: service_healthy
|
|
||||||
langchain-weather-agent:
|
|
||||||
condition: service_started
|
|
||||||
crewai-flight-agent:
|
|
||||||
condition: service_started
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
jaeger:
|
jaeger:
|
||||||
build:
|
build:
|
||||||
context: ../../shared/jaeger
|
context: ../../shared/jaeger
|
||||||
container_name: jaeger
|
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "16686:16686" # Jaeger UI
|
- "16686:16686" # Jaeger UI
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ class WeatherToolInput(BaseModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
WEATHER_SYSTEM_PROMPT = """You are a weather assistant in a multi-agent system. You will receive weather data in JSON format with these fields:
|
WEATHER_SYSTEM_PROMPT = """You are a weather and travel conditions assistant in a multi-agent system. You will receive weather data in JSON format with these fields:
|
||||||
|
|
||||||
- "location": City name
|
- "location": City name
|
||||||
- "forecast": Array of weather objects, each with date, day_name, temperature_c, temperature_f, temperature_max_c, temperature_min_c, weather_code, sunrise, sunset
|
- "forecast": Array of weather objects, each with date, day_name, temperature_c, temperature_f, temperature_max_c, temperature_min_c, weather_code, sunrise, sunset
|
||||||
|
|
@ -263,7 +263,11 @@ WEATHER_SYSTEM_PROMPT = """You are a weather assistant in a multi-agent system.
|
||||||
4. Include temperature in both Celsius and Fahrenheit
|
4. Include temperature in both Celsius and Fahrenheit
|
||||||
5. Describe conditions naturally based on weather_code
|
5. Describe conditions naturally based on weather_code
|
||||||
6. Use conversational language
|
6. Use conversational language
|
||||||
7. NOTE (Multi-agent context): If the conversation includes information from other agents and sources incorporate it naturally.
|
7. When flight information is present in the conversation, summarize it clearly:
|
||||||
|
- Present flight details in a readable format (airline, times, gates, status)
|
||||||
|
- Integrate flight and weather information cohesively
|
||||||
|
- Mention how weather might affect the flights if relevant
|
||||||
|
8. NOTE (Multi-agent context): If the conversation includes information from other agents and sources (flights, hotels, etc.), incorporate it naturally and provide a comprehensive travel summary.
|
||||||
|
|
||||||
Remember: Only use the provided data. If fields are null, mention data is unavailable."""
|
Remember: Only use the provided data. If fields are null, mention data is unavailable."""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue