-
Notifications
You must be signed in to change notification settings - Fork 10
Add Proxy Mode Demo #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ab_integration
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,20 @@ | ||
| [project] | ||
| name = "agentify-example-tau-bench" | ||
| name = "agentify-example-tau-bench-proxy" | ||
| version = "0.1.0" | ||
| description = "Example code of agentifying tau-bench for the blog `Agentify the Agent Assessment`." | ||
| readme = "README.md" | ||
| requires-python = ">=3.13" | ||
| dependencies = [ | ||
| "a2a-sdk[http-server]>=0.3.8", | ||
| "dotenv>=0.9.9", | ||
| "earthshaker>=0.1.12", | ||
| "earthshaker>=0.2.0", | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leave to xiaoyuan..? |
||
| "pydantic-settings>=2.11.0", | ||
| "requests>=2.31.0", | ||
| "tau-bench", | ||
| "typer>=0.19.2", | ||
| "uvicorn>=0.37.0", | ||
| ] | ||
|
|
||
| [tool.uv.sources] | ||
| earthshaker = { path = "../earthshaker", editable = true } | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how to fix this... |
||
| tau-bench = { git = "https://github.com/sierra-research/tau-bench.git" } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| cd "$(dirname "$0")/../.." | ||
| PYTHONPATH=. python src/green_agent/agent.py |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,20 +53,12 @@ async def execute(self, context: RequestContext, event_queue: EventQueue) -> Non | |
| "content": user_input, | ||
| } | ||
| ) | ||
| if os.environ.get("LITELLM_PROXY_API_KEY") is not None: | ||
| response = completion( | ||
| messages=messages, | ||
| model="openrouter/openai/gpt-4o", | ||
| custom_llm_provider="litellm_proxy", | ||
| temperature=0.0, | ||
| ) | ||
| else: | ||
| response = completion( | ||
| messages=messages, | ||
| model="openai/gpt-4o", | ||
| custom_llm_provider="openai", | ||
| temperature=0.0, | ||
| ) | ||
| response = completion( | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to do this? |
||
| messages=messages, | ||
| model="openai/gpt-4o", | ||
| custom_llm_provider="openai", | ||
| temperature=0.0, | ||
| ) | ||
| next_message = response.choices[0].message.model_dump() # type: ignore | ||
| messages.append( | ||
| { | ||
|
|
@@ -104,3 +96,8 @@ def start_white_agent(agent_name="general_white_agent", host="localhost", port=9 | |
| ) | ||
|
|
||
| uvicorn.run(app.build(), host=host, port=port) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| port = int(os.getenv("AGENT_PORT", "9002")) | ||
| start_white_agent(port=port) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| cd "$(dirname "$0")/../.." | ||
| PYTHONPATH=. python src/white_agent/agent.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: re-review this