Harshil Patel commited on
Commit
6b24b53
·
2 Parent(s): 83e804d 0660121

Merge branch 'main' of https://github.com/kunpai/HASHIRU

Browse files
Files changed (1) hide show
  1. src/manager/manager.py +7 -4
src/manager/manager.py CHANGED
@@ -343,13 +343,16 @@ class GeminiManager:
343
  print(chunk)
344
  for candidate in chunk.candidates:
345
  if candidate.content and candidate.content.parts:
346
- function_call_requests.append({
347
- "role": "function_call",
348
- "content": repr(candidate.content),
349
- })
350
  for part in candidate.content.parts:
351
  if part.function_call:
 
352
  function_calls.append(part.function_call)
 
 
 
 
 
353
  if full_text.strip() != "":
354
  messages.append({
355
  "role": "assistant",
 
343
  print(chunk)
344
  for candidate in chunk.candidates:
345
  if candidate.content and candidate.content.parts:
346
+ has_function_call = False
 
 
 
347
  for part in candidate.content.parts:
348
  if part.function_call:
349
+ has_function_call = True
350
  function_calls.append(part.function_call)
351
+ if has_function_call:
352
+ function_call_requests.append({
353
+ "role": "function_call",
354
+ "content": repr(candidate.content),
355
+ })
356
  if full_text.strip() != "":
357
  messages.append({
358
  "role": "assistant",