This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: gateway.networking.k8s.io/v1 | |
| kind: HTTPRoute | |
| metadata: | |
| name: echo-route | |
| namespace: demo | |
| spec: | |
| parentRefs: | |
| - name: demo-gateway | |
| namespace: nginx-gateway | |
| rules: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: gateway.networking.k8s.io/v1 | |
| kind: Gateway | |
| metadata: | |
| name: demo-gateway | |
| namespace: nginx-gateway | |
| spec: | |
| gatewayClassName: nginx | |
| listeners: | |
| - name: http | |
| protocol: HTTP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: demo | |
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: demo-app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Part 1 - Imports | |
| import os | |
| import sys | |
| import asyncio | |
| import logging | |
| import re | |
| from typing import Optional, Dict, Any | |
| from google.adk.agents import LlmAgent, SequentialAgent | |
| from google.adk.runners import Runner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Part 1 - Import modules | |
| import asyncio | |
| import logging | |
| from typing import Dict, TypedDict | |
| from google.adk.agents import LlmAgent | |
| from google.adk.sessions import InMemorySessionService | |
| from google.adk.runners import Runner | |
| from google.genai import types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # client.py | |
| import asyncio | |
| from fastmcp import Client | |
| from fastmcp.client.elicitation import ElicitResult | |
| from google import genai | |
| from google.genai import types | |
| async def send_to_gemini(flight_status_result: str, user_query: str = None): | |
| """Send flight status result to Gemini for analysis.""" | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # server.py | |
| from fastmcp import FastMCP, Context | |
| from dataclasses import dataclass | |
| import httpx | |
| import os | |
| from datetime import datetime, timedelta | |
| import pytz | |
| mcp = FastMCP("Flight Status Server") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import asyncio | |
| from google import genai | |
| from mcp import ClientSession | |
| from mcp.client.streamable_http import streamablehttp_client | |
| import warnings | |
| warnings.filterwarnings("ignore") | |
| MCP_SERVER_URL = "http://127.0.0.1:8080/mcp/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from fastmcp import FastMCP | |
| mcp = FastMCP("Employee Server") | |
| @mcp.tool() | |
| def get_employees() -> list: | |
| return [ | |
| {"id": 1, "name": "Alice", "role": "Engineer"}, | |
| {"id": 2, "name": "Bob", "role": "Designer"}, | |
| {"id": 3, "name": "Charlie", "role": "Manager"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM docker.io/python:alpine | |
| WORKDIR /content | |
| RUN apk add curl | |
| RUN echo '<!DOCTYPE html><html><head><title>Hello</title></head><body><h1>Hello, world!</h1></body></html>' > index.html | |
| CMD ["python3", "-m", "http.server", "80", "--bind", "0.0.0.0"] |
NewerOlder