Spaces:
Runtime error
Runtime error
Commit
·
8ca7a9f
1
Parent(s):
ef4bdf0
switch from openai to gemini
Browse files
agent.py
CHANGED
|
@@ -7,15 +7,6 @@ from contextlib import AsyncExitStack
|
|
| 7 |
from mcp import ClientSession, StdioServerParameters
|
| 8 |
from mcp.client.stdio import stdio_client
|
| 9 |
|
| 10 |
-
from phoenix.otel import register
|
| 11 |
-
|
| 12 |
-
# configure the Phoenix tracer
|
| 13 |
-
# tracer_provider = register(
|
| 14 |
-
# endpoint=os.getenv("PHOENIX_ENDPOINT"),
|
| 15 |
-
# project_name="gradio", # Default is 'default'
|
| 16 |
-
# auto_instrument=True, # Auto-instrument your app based on installed OI dependencies
|
| 17 |
-
# )
|
| 18 |
-
|
| 19 |
instructions = """
|
| 20 |
Your task is to help users build and modify Gradio applications within this interactive sandbox
|
| 21 |
environment. You are a Gradio application builder that can read, understand, and edit Python code
|
|
@@ -450,7 +441,7 @@ def think(reflection: str) -> str:
|
|
| 450 |
|
| 451 |
|
| 452 |
agent = CodeAgent(
|
| 453 |
-
model=LiteLLMModel(model_id="
|
| 454 |
instructions=instructions,
|
| 455 |
tools=[
|
| 456 |
read_code,
|
|
|
|
| 7 |
from mcp import ClientSession, StdioServerParameters
|
| 8 |
from mcp.client.stdio import stdio_client
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
instructions = """
|
| 11 |
Your task is to help users build and modify Gradio applications within this interactive sandbox
|
| 12 |
environment. You are a Gradio application builder that can read, understand, and edit Python code
|
|
|
|
| 441 |
|
| 442 |
|
| 443 |
agent = CodeAgent(
|
| 444 |
+
model=LiteLLMModel(model_id="gemini/gemini-2.5-flash", api_key=os.getenv("GEMINI_API_KEY")),
|
| 445 |
instructions=instructions,
|
| 446 |
tools=[
|
| 447 |
read_code,
|