bstraehle commited on
Commit
6c7c564
·
verified ·
1 Parent(s): e15a96a

Update agents/tools/ai_tools.py

Browse files
Files changed (1) hide show
  1. agents/tools/ai_tools.py +8 -41
agents/tools/ai_tools.py CHANGED
@@ -131,16 +131,7 @@ class AITools():
131
 
132
  response = client.models.generate_content(
133
  model=LLM_IMAGE_ANALYSIS,
134
- contents=[
135
- types.Content(
136
- parts=[
137
- types.Part(
138
- file_data=types.FileData(file_uri=file.uri)
139
- ),
140
- types.Part(text=question.strip())
141
- ]
142
- )
143
- ],
144
  config=types.GenerateContentConfig(
145
  thinking_config=types.ThinkingConfig(
146
  thinking_level=THINKING_LEVEL_TOOLS
@@ -173,16 +164,7 @@ class AITools():
173
 
174
  response = client.models.generate_content(
175
  model=LLM_AUDIO_ANALYSIS,
176
- contents=[
177
- types.Content(
178
- parts=[
179
- types.Part(
180
- file_data=types.FileData(file_uri=file.uri)
181
- ),
182
- types.Part(text=question.strip())
183
- ]
184
- )
185
- ],
186
  config=types.GenerateContentConfig(
187
  thinking_config=types.ThinkingConfig(
188
  thinking_level=THINKING_LEVEL_TOOLS
@@ -215,16 +197,7 @@ class AITools():
215
 
216
  response = client.models.generate_content(
217
  model=LLM_VIDEO_ANALYSIS,
218
- contents=[
219
- types.Content(
220
- parts=[
221
- types.Part(
222
- file_data=types.FileData(file_uri=file.uri)
223
- ),
224
- types.Part(text=question.strip())
225
- ]
226
- )
227
- ],
228
  config=types.GenerateContentConfig(
229
  thinking_config=types.ThinkingConfig(
230
  thinking_level=THINKING_LEVEL_TOOLS
@@ -367,16 +340,7 @@ class AITools():
367
 
368
  response = client.models.generate_content(
369
  model=LLM_CODE_EXECUTION,
370
- contents=[
371
- types.Content(
372
- parts=[
373
- types.Part(
374
- file_data=types.FileData(file_uri=file.uri)
375
- ),
376
- types.Part(text=question.strip())
377
- ]
378
- )
379
- ],
380
  config=types.GenerateContentConfig(
381
  tools=[types.Tool(code_execution=types.ToolCodeExecution)],
382
  thinking_config=types.ThinkingConfig(
@@ -425,10 +389,13 @@ class AITools():
425
  )
426
  ]
427
  )
 
 
428
 
429
  response = client.models.generate_content(
430
  model=LLM_IMAGE_TO_FEN,
431
- contents=[content],
 
432
  config=types.GenerateContentConfig(
433
  thinking_config=types.ThinkingConfig(
434
  thinking_level=THINKING_LEVEL_TOOLS
 
131
 
132
  response = client.models.generate_content(
133
  model=LLM_IMAGE_ANALYSIS,
134
+ contents=[file, question],
 
 
 
 
 
 
 
 
 
135
  config=types.GenerateContentConfig(
136
  thinking_config=types.ThinkingConfig(
137
  thinking_level=THINKING_LEVEL_TOOLS
 
164
 
165
  response = client.models.generate_content(
166
  model=LLM_AUDIO_ANALYSIS,
167
+ contents=[file, question],
 
 
 
 
 
 
 
 
 
168
  config=types.GenerateContentConfig(
169
  thinking_config=types.ThinkingConfig(
170
  thinking_level=THINKING_LEVEL_TOOLS
 
197
 
198
  response = client.models.generate_content(
199
  model=LLM_VIDEO_ANALYSIS,
200
+ contents=[file, question],
 
 
 
 
 
 
 
 
 
201
  config=types.GenerateContentConfig(
202
  thinking_config=types.ThinkingConfig(
203
  thinking_level=THINKING_LEVEL_TOOLS
 
340
 
341
  response = client.models.generate_content(
342
  model=LLM_CODE_EXECUTION,
343
+ contents=[file, question],
 
 
 
 
 
 
 
 
 
344
  config=types.GenerateContentConfig(
345
  tools=[types.Tool(code_execution=types.ToolCodeExecution)],
346
  thinking_config=types.ThinkingConfig(
 
389
  )
390
  ]
391
  )
392
+
393
+ file = client.files.upload(file=file_path) # TODO
394
 
395
  response = client.models.generate_content(
396
  model=LLM_IMAGE_TO_FEN,
397
+ #contents=[content], # TODO
398
+ contents=[file, question],
399
  config=types.GenerateContentConfig(
400
  thinking_config=types.ThinkingConfig(
401
  thinking_level=THINKING_LEVEL_TOOLS