Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -71,6 +71,13 @@ class GeminiHandler(AsyncStreamHandler):
|
|
71 |
http_options={"api_version": "v1alpha"},
|
72 |
)
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
config = LiveConnectConfig(
|
75 |
response_modalities=["AUDIO"], # type: ignore
|
76 |
speech_config=SpeechConfig(
|
@@ -79,7 +86,7 @@ class GeminiHandler(AsyncStreamHandler):
|
|
79 |
voice_name=voice_name,
|
80 |
)
|
81 |
)
|
82 |
-
),
|
83 |
)
|
84 |
async with client.aio.live.connect(
|
85 |
model="gemini-2.0-flash-exp", config=config
|
|
|
71 |
http_options={"api_version": "v1alpha"},
|
72 |
)
|
73 |
|
74 |
+
tools = [
|
75 |
+
types.Tool(code_execution=types.ToolCodeExecution),
|
76 |
+
types.Tool(google_search=types.GoogleSearch()),
|
77 |
+
]
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
config = LiveConnectConfig(
|
82 |
response_modalities=["AUDIO"], # type: ignore
|
83 |
speech_config=SpeechConfig(
|
|
|
86 |
voice_name=voice_name,
|
87 |
)
|
88 |
)
|
89 |
+
)tools,
|
90 |
)
|
91 |
async with client.aio.live.connect(
|
92 |
model="gemini-2.0-flash-exp", config=config
|