Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ server_params = StdioServerParameters(
|
|
| 16 |
]
|
| 17 |
)
|
| 18 |
|
| 19 |
-
async def
|
| 20 |
try:
|
| 21 |
client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
|
| 22 |
except Exception as e:
|
|
@@ -192,9 +192,9 @@ Choose the appropriate tool based on the user's intent. For train connections, u
|
|
| 192 |
return f"Fehler während der Verarbeitung: {str(e)}\n\n{traceback.format_exc()}", ""
|
| 193 |
|
| 194 |
# Gradio UI Wrapper
|
| 195 |
-
def
|
| 196 |
try:
|
| 197 |
-
return asyncio.run(
|
| 198 |
except Exception as e:
|
| 199 |
import traceback
|
| 200 |
return f"UI Fehler: {str(e)}\n\n{traceback.format_exc()}", ""
|
|
|
|
| 16 |
]
|
| 17 |
)
|
| 18 |
|
| 19 |
+
async def generate1(input_text):
|
| 20 |
try:
|
| 21 |
client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
|
| 22 |
except Exception as e:
|
|
|
|
| 192 |
return f"Fehler während der Verarbeitung: {str(e)}\n\n{traceback.format_exc()}", ""
|
| 193 |
|
| 194 |
# Gradio UI Wrapper
|
| 195 |
+
def generate(input_text):
|
| 196 |
try:
|
| 197 |
+
return asyncio.run(generate1(input_text))
|
| 198 |
except Exception as e:
|
| 199 |
import traceback
|
| 200 |
return f"UI Fehler: {str(e)}\n\n{traceback.format_exc()}", ""
|