agno 2.0.0rc1__py3-none-any.whl → 2.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. agno/agent/agent.py +101 -140
  2. agno/db/mongo/mongo.py +8 -3
  3. agno/eval/accuracy.py +12 -5
  4. agno/knowledge/chunking/strategy.py +14 -14
  5. agno/knowledge/knowledge.py +156 -120
  6. agno/knowledge/reader/arxiv_reader.py +5 -5
  7. agno/knowledge/reader/csv_reader.py +6 -77
  8. agno/knowledge/reader/docx_reader.py +5 -5
  9. agno/knowledge/reader/firecrawl_reader.py +5 -5
  10. agno/knowledge/reader/json_reader.py +5 -5
  11. agno/knowledge/reader/markdown_reader.py +31 -9
  12. agno/knowledge/reader/pdf_reader.py +10 -123
  13. agno/knowledge/reader/reader_factory.py +65 -72
  14. agno/knowledge/reader/s3_reader.py +44 -114
  15. agno/knowledge/reader/text_reader.py +5 -5
  16. agno/knowledge/reader/url_reader.py +75 -31
  17. agno/knowledge/reader/web_search_reader.py +6 -29
  18. agno/knowledge/reader/website_reader.py +5 -5
  19. agno/knowledge/reader/wikipedia_reader.py +5 -5
  20. agno/knowledge/reader/youtube_reader.py +6 -6
  21. agno/knowledge/reranker/__init__.py +9 -0
  22. agno/knowledge/utils.py +10 -10
  23. agno/media.py +269 -268
  24. agno/models/aws/bedrock.py +3 -7
  25. agno/models/base.py +50 -54
  26. agno/models/google/gemini.py +11 -10
  27. agno/models/message.py +4 -4
  28. agno/models/ollama/chat.py +1 -1
  29. agno/models/openai/chat.py +33 -14
  30. agno/models/response.py +5 -5
  31. agno/os/app.py +40 -29
  32. agno/os/mcp.py +39 -59
  33. agno/os/router.py +547 -16
  34. agno/os/routers/evals/evals.py +197 -12
  35. agno/os/routers/knowledge/knowledge.py +428 -14
  36. agno/os/routers/memory/memory.py +250 -28
  37. agno/os/routers/metrics/metrics.py +125 -7
  38. agno/os/routers/session/session.py +393 -25
  39. agno/os/schema.py +55 -2
  40. agno/run/agent.py +37 -28
  41. agno/run/base.py +9 -19
  42. agno/run/team.py +110 -19
  43. agno/run/workflow.py +41 -28
  44. agno/team/team.py +808 -1080
  45. agno/tools/brightdata.py +3 -3
  46. agno/tools/cartesia.py +3 -5
  47. agno/tools/dalle.py +7 -4
  48. agno/tools/desi_vocal.py +2 -2
  49. agno/tools/e2b.py +6 -6
  50. agno/tools/eleven_labs.py +3 -3
  51. agno/tools/fal.py +4 -4
  52. agno/tools/function.py +7 -7
  53. agno/tools/giphy.py +2 -2
  54. agno/tools/lumalab.py +3 -3
  55. agno/tools/mcp.py +1 -2
  56. agno/tools/models/azure_openai.py +2 -2
  57. agno/tools/models/gemini.py +3 -3
  58. agno/tools/models/groq.py +3 -5
  59. agno/tools/models/nebius.py +2 -2
  60. agno/tools/models_labs.py +5 -5
  61. agno/tools/openai.py +4 -9
  62. agno/tools/opencv.py +3 -3
  63. agno/tools/replicate.py +7 -7
  64. agno/utils/events.py +5 -5
  65. agno/utils/gemini.py +1 -1
  66. agno/utils/log.py +52 -2
  67. agno/utils/mcp.py +57 -5
  68. agno/utils/models/aws_claude.py +1 -1
  69. agno/utils/models/claude.py +0 -8
  70. agno/utils/models/cohere.py +1 -1
  71. agno/utils/models/watsonx.py +1 -1
  72. agno/utils/openai.py +1 -1
  73. agno/utils/print_response/team.py +177 -73
  74. agno/utils/streamlit.py +27 -0
  75. agno/vectordb/lancedb/lance_db.py +82 -25
  76. agno/workflow/step.py +7 -7
  77. agno/workflow/types.py +13 -13
  78. agno/workflow/workflow.py +37 -28
  79. {agno-2.0.0rc1.dist-info → agno-2.0.1.dist-info}/METADATA +140 -1
  80. {agno-2.0.0rc1.dist-info → agno-2.0.1.dist-info}/RECORD +83 -84
  81. agno-2.0.1.dist-info/licenses/LICENSE +201 -0
  82. agno/knowledge/reader/gcs_reader.py +0 -67
  83. agno-2.0.0rc1.dist-info/licenses/LICENSE +0 -375
  84. {agno-2.0.0rc1.dist-info → agno-2.0.1.dist-info}/WHEEL +0 -0
  85. {agno-2.0.0rc1.dist-info → agno-2.0.1.dist-info}/top_level.txt +0 -0
agno/run/workflow.py CHANGED
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
5
5
 
6
6
  from pydantic import BaseModel
7
7
 
8
- from agno.media import AudioArtifact, AudioResponse, ImageArtifact, VideoArtifact
8
+ from agno.media import Audio, Image, Video
9
9
  from agno.run.agent import RunOutput
10
10
  from agno.run.base import RunStatus
11
11
  from agno.run.team import TeamRunOutput
@@ -13,6 +13,9 @@ from agno.utils.log import log_error
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  from agno.workflow.types import StepOutput, WorkflowMetrics
16
+ else:
17
+ StepOutput = Any
18
+ WorkflowMetrics = Any
16
19
 
17
20
 
18
21
  class WorkflowRunEvent(str, Enum):
@@ -46,6 +49,8 @@ class WorkflowRunEvent(str, Enum):
46
49
 
47
50
  step_output = "StepOutput"
48
51
 
52
+ custom_event = "CustomEvent"
53
+
49
54
 
50
55
  @dataclass
51
56
  class BaseWorkflowRunOutputEvent:
@@ -132,7 +137,7 @@ class WorkflowCompletedEvent(BaseWorkflowRunOutputEvent):
132
137
  content_type: str = "str"
133
138
 
134
139
  # Store actual step execution results as StepOutput objects
135
- step_results: List["StepOutput"] = field(default_factory=list) # noqa: F821
140
+ step_results: List[StepOutput] = field(default_factory=list)
136
141
  metadata: Optional[Dict[str, Any]] = None
137
142
 
138
143
 
@@ -177,13 +182,13 @@ class StepCompletedEvent(BaseWorkflowRunOutputEvent):
177
182
  content_type: str = "str"
178
183
 
179
184
  # Media content fields
180
- images: Optional[List[ImageArtifact]] = None
181
- videos: Optional[List[VideoArtifact]] = None
182
- audio: Optional[List[AudioArtifact]] = None
183
- response_audio: Optional[AudioResponse] = None
185
+ images: Optional[List[Image]] = None
186
+ videos: Optional[List[Video]] = None
187
+ audio: Optional[List[Audio]] = None
188
+ response_audio: Optional[Audio] = None
184
189
 
185
190
  # Store actual step execution results as StepOutput objects
186
- step_response: Optional["StepOutput"] = None # noqa: F821
191
+ step_response: Optional[StepOutput] = None
187
192
 
188
193
 
189
194
  @dataclass
@@ -226,7 +231,7 @@ class LoopIterationCompletedEvent(BaseWorkflowRunOutputEvent):
226
231
  step_index: Optional[Union[int, tuple]] = None
227
232
  iteration: int = 0
228
233
  max_iterations: Optional[int] = None
229
- iteration_results: List["StepOutput"] = field(default_factory=list) # noqa: F821
234
+ iteration_results: List[StepOutput] = field(default_factory=list)
230
235
  should_continue: bool = True
231
236
 
232
237
 
@@ -239,7 +244,7 @@ class LoopExecutionCompletedEvent(BaseWorkflowRunOutputEvent):
239
244
  step_index: Optional[Union[int, tuple]] = None
240
245
  total_iterations: int = 0
241
246
  max_iterations: Optional[int] = None
242
- all_results: List[List["StepOutput"]] = field(default_factory=list) # noqa: F821
247
+ all_results: List[List[StepOutput]] = field(default_factory=list)
243
248
 
244
249
 
245
250
  @dataclass
@@ -262,7 +267,7 @@ class ParallelExecutionCompletedEvent(BaseWorkflowRunOutputEvent):
262
267
  parallel_step_count: Optional[int] = None
263
268
 
264
269
  # Results from all parallel steps
265
- step_results: List["StepOutput"] = field(default_factory=list) # noqa: F821
270
+ step_results: List[StepOutput] = field(default_factory=list)
266
271
 
267
272
 
268
273
  @dataclass
@@ -286,7 +291,7 @@ class ConditionExecutionCompletedEvent(BaseWorkflowRunOutputEvent):
286
291
  executed_steps: Optional[int] = None
287
292
 
288
293
  # Results from executed steps
289
- step_results: List["StepOutput"] = field(default_factory=list) # noqa: F821
294
+ step_results: List[StepOutput] = field(default_factory=list)
290
295
 
291
296
 
292
297
  @dataclass
@@ -312,7 +317,7 @@ class RouterExecutionCompletedEvent(BaseWorkflowRunOutputEvent):
312
317
  executed_steps: Optional[int] = None
313
318
 
314
319
  # Results from executed steps
315
- step_results: List["StepOutput"] = field(default_factory=list) # noqa: F821
320
+ step_results: List[StepOutput] = field(default_factory=list)
316
321
 
317
322
 
318
323
  @dataclass
@@ -336,7 +341,7 @@ class StepsExecutionCompletedEvent(BaseWorkflowRunOutputEvent):
336
341
  executed_steps: Optional[int] = None
337
342
 
338
343
  # Results from executed steps
339
- step_results: List["StepOutput"] = field(default_factory=list) # noqa: F821
344
+ step_results: List[StepOutput] = field(default_factory=list)
340
345
 
341
346
 
342
347
  @dataclass
@@ -348,7 +353,7 @@ class StepOutputEvent(BaseWorkflowRunOutputEvent):
348
353
  step_index: Optional[Union[int, tuple]] = None
349
354
 
350
355
  # Store actual step execution result as StepOutput object
351
- step_output: Optional["StepOutput"] = None # noqa: F821
356
+ step_output: Optional[StepOutput] = None
352
357
 
353
358
  # Properties for backward compatibility
354
359
  @property
@@ -356,15 +361,15 @@ class StepOutputEvent(BaseWorkflowRunOutputEvent):
356
361
  return self.step_output.content if self.step_output else None
357
362
 
358
363
  @property
359
- def images(self) -> Optional[List[ImageArtifact]]:
364
+ def images(self) -> Optional[List[Image]]:
360
365
  return self.step_output.images if self.step_output else None
361
366
 
362
367
  @property
363
- def videos(self) -> Optional[List[VideoArtifact]]:
368
+ def videos(self) -> Optional[List[Video]]:
364
369
  return self.step_output.videos if self.step_output else None
365
370
 
366
371
  @property
367
- def audio(self) -> Optional[List[AudioArtifact]]:
372
+ def audio(self) -> Optional[List[Audio]]:
368
373
  return self.step_output.audio if self.step_output else None
369
374
 
370
375
  @property
@@ -380,6 +385,13 @@ class StepOutputEvent(BaseWorkflowRunOutputEvent):
380
385
  return self.step_output.stop if self.step_output else False
381
386
 
382
387
 
388
+ @dataclass
389
+ class CustomEvent(BaseWorkflowRunOutputEvent):
390
+ """Event sent when a custom event is produced"""
391
+
392
+ event: str = WorkflowRunEvent.custom_event.value
393
+
394
+
383
395
  # Union type for all workflow run response events
384
396
  WorkflowRunOutputEvent = Union[
385
397
  WorkflowStartedEvent,
@@ -402,6 +414,7 @@ WorkflowRunOutputEvent = Union[
402
414
  StepsExecutionStartedEvent,
403
415
  StepsExecutionCompletedEvent,
404
416
  StepOutputEvent,
417
+ CustomEvent,
405
418
  ]
406
419
 
407
420
 
@@ -420,13 +433,13 @@ class WorkflowRunOutput:
420
433
  session_id: Optional[str] = None
421
434
 
422
435
  # Media content fields
423
- images: Optional[List[ImageArtifact]] = None
424
- videos: Optional[List[VideoArtifact]] = None
425
- audio: Optional[List[AudioArtifact]] = None
426
- response_audio: Optional[AudioResponse] = None
436
+ images: Optional[List[Image]] = None
437
+ videos: Optional[List[Video]] = None
438
+ audio: Optional[List[Audio]] = None
439
+ response_audio: Optional[Audio] = None
427
440
 
428
441
  # Store actual step execution results as StepOutput objects
429
- step_results: List[Union["StepOutput", List["StepOutput"]]] = field(default_factory=list) # noqa: F821
442
+ step_results: List[Union[StepOutput, List[StepOutput]]] = field(default_factory=list)
430
443
 
431
444
  # Store agent/team responses separately with parent_run_id references
432
445
  step_executor_runs: Optional[List[Union[RunOutput, TeamRunOutput]]] = None
@@ -435,7 +448,7 @@ class WorkflowRunOutput:
435
448
  events: Optional[List[WorkflowRunOutputEvent]] = None
436
449
 
437
450
  # Workflow metrics aggregated from all steps
438
- metrics: Optional["WorkflowMetrics"] = None
451
+ metrics: Optional[WorkflowMetrics] = None
439
452
 
440
453
  metadata: Optional[Dict[str, Any]] = None
441
454
  created_at: int = field(default_factory=lambda: int(time()))
@@ -521,7 +534,7 @@ class WorkflowRunOutput:
521
534
  workflow_metrics = WorkflowMetrics.from_dict(workflow_metrics_dict)
522
535
 
523
536
  step_results = data.pop("step_results", [])
524
- parsed_step_results: List[Union["StepOutput", List["StepOutput"]]] = []
537
+ parsed_step_results: List[Union[StepOutput, List[StepOutput]]] = []
525
538
  if step_results:
526
539
  for step_output_dict in step_results:
527
540
  # Reconstruct StepOutput from dict
@@ -541,16 +554,16 @@ class WorkflowRunOutput:
541
554
  metadata = data.pop("metadata", None)
542
555
 
543
556
  images = data.pop("images", [])
544
- images = [ImageArtifact.model_validate(image) for image in images] if images else None
557
+ images = [Image.model_validate(image) for image in images] if images else None
545
558
 
546
559
  videos = data.pop("videos", [])
547
- videos = [VideoArtifact.model_validate(video) for video in videos] if videos else None
560
+ videos = [Video.model_validate(video) for video in videos] if videos else None
548
561
 
549
562
  audio = data.pop("audio", [])
550
- audio = [AudioArtifact.model_validate(audio) for audio in audio] if audio else None
563
+ audio = [Audio.model_validate(audio) for audio in audio] if audio else None
551
564
 
552
565
  response_audio = data.pop("response_audio", None)
553
- response_audio = AudioResponse.model_validate(response_audio) if response_audio else None
566
+ response_audio = Audio.model_validate(response_audio) if response_audio else None
554
567
 
555
568
  events = data.pop("events", [])
556
569