mgokg commited on
Commit
045aa85
·
verified ·
1 Parent(s): 944e661

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -69,10 +69,16 @@ async def generate(input_text):
69
  if not response.candidates or not response.candidates[0].content.parts:
70
  break
71
 
72
- tool_calls = [p.tool_call for p in response.candidates[0].content.parts if p.tool_call]
73
- if not tool_calls:
74
- break
75
-
 
 
 
 
 
 
76
  tool_responses = []
77
  for call in tool_calls:
78
  if call.name == "get_train_connections":
 
69
  if not response.candidates or not response.candidates[0].content.parts:
70
  break
71
 
72
+ #tool_calls = [p.tool_call for p in response.candidates[0].content.parts if p.tool_call]
73
+ #if not tool_calls:
74
+ #break
75
+
76
+ part = response.candidates[0].content.parts[0]
77
+ if part.function_call:
78
+ function_name = part.function_call.name
79
+ arguments = part.function_call.args
80
+ print(f"Rufe Funktion {function_name} mit {arguments} auf")
81
+
82
  tool_responses = []
83
  for call in tool_calls:
84
  if call.name == "get_train_connections":