import os
from a2a.types import (
Message,
)
from beeai_sdk.server import Server
from beeai_sdk.server.context import Context
from beeai_sdk.a2a.extensions import AgentDetail, AgentDetailContributor, AgentDetailTool
server = Server()
@server.agent(
detail=AgentDetail(
ui_type="chat",
user_greeting="Welcome! I'm here to help you with your tasks.",
input_placeholder="Ask anything...",
license="Apache 2.0",
programming_language="Python",
framework="BeeAI",
tools=[
AgentDetailTool(
name="Weather",
description="Get the weather for a given location",
),
],
homepage_url="https://github.com/beeai-dev/beeai-agents",
source_code_url="https://github.com/beeai-dev/beeai-agents",
container_image_url="ghcr.io/beeai-dev/beeai-agents:v0.0.1",
author=AgentDetailContributor(
name="BeeAI",
email="info@beeai.dev",
url="https://beeai.dev",
),
contributors=[
AgentDetailContributor(
name="Another Person",
email="another@beeai.dev",
url="https://beeai.dev",
),
]
)
)
async def example_agent(input: Message, context: Context):
"""An example agent with detailed configuration"""
yield "Hello World!"
def run():
server.run(host=os.getenv("HOST", "127.0.0.1"), port=int(os.getenv("PORT", 8000)))
if __name__ == "__main__":
run()