Spaces:
Runtime error
Runtime error
Update utils.py
Browse files
utils.py
CHANGED
@@ -510,6 +510,27 @@ def wait_on_run(run, thread, client):
|
|
510 |
time.sleep(0.5)
|
511 |
return run
|
512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
|
514 |
|
515 |
#########################################
|
|
|
510 |
time.sleep(0.5)
|
511 |
return run
|
512 |
|
513 |
+
########################################
|
514 |
+
#Assistant für Websuche anlgen
|
515 |
+
def openai_assistant_suche(client, general_prompt):
|
516 |
+
assistant = client.beta.assistants.create(
|
517 |
+
instructions=general_prompt,
|
518 |
+
model="gpt-4-1106-preview",
|
519 |
+
tools=[{
|
520 |
+
"type": "function",
|
521 |
+
"function": {
|
522 |
+
"name": "tavily_search",
|
523 |
+
"description": "Get information on recent events from the web.",
|
524 |
+
"parameters": {
|
525 |
+
"type": "object",
|
526 |
+
"properties": {
|
527 |
+
"query": {"type": "string", "description": "The search query to use. For example: 'Latest news on Nvidia stock performance'"},
|
528 |
+
},
|
529 |
+
"required": ["query"]
|
530 |
+
}
|
531 |
+
}
|
532 |
+
}]
|
533 |
+
)
|
534 |
|
535 |
|
536 |
#########################################
|