agno 2.0.0a1__py3-none-any.whl → 2.0.0rc2__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.
- agno/agent/agent.py +416 -41
- agno/api/agent.py +2 -2
- agno/api/evals.py +2 -2
- agno/api/os.py +1 -1
- agno/api/settings.py +2 -2
- agno/api/team.py +2 -2
- agno/db/dynamo/dynamo.py +0 -6
- agno/db/firestore/firestore.py +0 -6
- agno/db/in_memory/in_memory_db.py +0 -6
- agno/db/json/json_db.py +0 -6
- agno/db/mongo/mongo.py +8 -9
- agno/db/mysql/utils.py +0 -1
- agno/db/postgres/postgres.py +0 -10
- agno/db/postgres/utils.py +0 -1
- agno/db/redis/redis.py +0 -4
- agno/db/singlestore/singlestore.py +0 -10
- agno/db/singlestore/utils.py +0 -1
- agno/db/sqlite/sqlite.py +0 -4
- agno/db/sqlite/utils.py +0 -1
- agno/eval/accuracy.py +12 -5
- agno/integrations/discord/client.py +5 -1
- agno/knowledge/chunking/strategy.py +14 -14
- agno/knowledge/embedder/aws_bedrock.py +2 -2
- agno/knowledge/knowledge.py +156 -120
- agno/knowledge/reader/arxiv_reader.py +5 -5
- agno/knowledge/reader/csv_reader.py +6 -77
- agno/knowledge/reader/docx_reader.py +5 -5
- agno/knowledge/reader/firecrawl_reader.py +5 -5
- agno/knowledge/reader/json_reader.py +5 -5
- agno/knowledge/reader/markdown_reader.py +31 -9
- agno/knowledge/reader/pdf_reader.py +10 -123
- agno/knowledge/reader/reader_factory.py +65 -72
- agno/knowledge/reader/s3_reader.py +44 -114
- agno/knowledge/reader/text_reader.py +5 -5
- agno/knowledge/reader/url_reader.py +75 -31
- agno/knowledge/reader/web_search_reader.py +6 -29
- agno/knowledge/reader/website_reader.py +5 -5
- agno/knowledge/reader/wikipedia_reader.py +5 -5
- agno/knowledge/reader/youtube_reader.py +6 -6
- agno/knowledge/utils.py +10 -10
- agno/models/anthropic/claude.py +2 -49
- agno/models/aws/bedrock.py +3 -7
- agno/models/base.py +37 -6
- agno/models/message.py +7 -6
- agno/os/app.py +168 -64
- agno/os/interfaces/agui/agui.py +1 -1
- agno/os/interfaces/agui/utils.py +16 -9
- agno/os/interfaces/slack/slack.py +2 -3
- agno/os/interfaces/whatsapp/whatsapp.py +2 -3
- agno/os/mcp.py +235 -0
- agno/os/router.py +576 -19
- agno/os/routers/evals/evals.py +201 -12
- agno/os/routers/knowledge/knowledge.py +455 -18
- agno/os/routers/memory/memory.py +260 -29
- agno/os/routers/metrics/metrics.py +127 -7
- agno/os/routers/session/session.py +398 -25
- agno/os/schema.py +55 -2
- agno/os/settings.py +0 -1
- agno/run/agent.py +96 -2
- agno/run/cancel.py +0 -2
- agno/run/team.py +93 -2
- agno/run/workflow.py +25 -12
- agno/team/team.py +863 -1053
- agno/tools/function.py +65 -7
- agno/tools/linear.py +1 -1
- agno/tools/mcp.py +1 -2
- agno/utils/gemini.py +31 -1
- agno/utils/log.py +52 -2
- agno/utils/mcp.py +55 -3
- agno/utils/models/claude.py +41 -0
- agno/utils/print_response/team.py +177 -73
- agno/utils/streamlit.py +481 -0
- agno/workflow/workflow.py +17 -1
- {agno-2.0.0a1.dist-info → agno-2.0.0rc2.dist-info}/METADATA +1 -1
- {agno-2.0.0a1.dist-info → agno-2.0.0rc2.dist-info}/RECORD +78 -77
- agno/knowledge/reader/gcs_reader.py +0 -67
- {agno-2.0.0a1.dist-info → agno-2.0.0rc2.dist-info}/WHEEL +0 -0
- {agno-2.0.0a1.dist-info → agno-2.0.0rc2.dist-info}/licenses/LICENSE +0 -0
- {agno-2.0.0a1.dist-info → agno-2.0.0rc2.dist-info}/top_level.txt +0 -0
agno/api/evals.py
CHANGED
|
@@ -8,7 +8,7 @@ def create_eval_run_telemetry(eval_run: EvalRunCreate) -> None:
|
|
|
8
8
|
"""Telemetry recording for Eval runs"""
|
|
9
9
|
with api.Client() as api_client:
|
|
10
10
|
try:
|
|
11
|
-
api_client.post(ApiRoutes.EVAL_RUN_CREATE, json=
|
|
11
|
+
api_client.post(ApiRoutes.EVAL_RUN_CREATE, json=eval_run.model_dump(exclude_none=True))
|
|
12
12
|
except Exception as e:
|
|
13
13
|
log_debug(f"Could not create evaluation run: {e}")
|
|
14
14
|
|
|
@@ -17,6 +17,6 @@ async def async_create_eval_run_telemetry(eval_run: EvalRunCreate) -> None:
|
|
|
17
17
|
"""Telemetry recording for async Eval runs"""
|
|
18
18
|
async with api.AsyncClient() as api_client:
|
|
19
19
|
try:
|
|
20
|
-
await api_client.post(ApiRoutes.EVAL_RUN_CREATE, json=
|
|
20
|
+
await api_client.post(ApiRoutes.EVAL_RUN_CREATE, json=eval_run.model_dump(exclude_none=True))
|
|
21
21
|
except Exception as e:
|
|
22
22
|
log_debug(f"Could not create evaluation run: {e}")
|
agno/api/os.py
CHANGED
|
@@ -10,7 +10,7 @@ def log_os_telemetry(launch: OSLaunch) -> None:
|
|
|
10
10
|
try:
|
|
11
11
|
response = api_client.post(
|
|
12
12
|
ApiRoutes.AGENT_OS_LAUNCH,
|
|
13
|
-
json=
|
|
13
|
+
json=launch.model_dump(exclude_none=True),
|
|
14
14
|
)
|
|
15
15
|
response.raise_for_status()
|
|
16
16
|
except Exception as e:
|
agno/api/settings.py
CHANGED
|
@@ -16,7 +16,7 @@ class AgnoAPISettings(BaseSettings):
|
|
|
16
16
|
api_runtime: str = "prd"
|
|
17
17
|
alpha_features: bool = False
|
|
18
18
|
|
|
19
|
-
api_url: str = "https://api.agno.com"
|
|
19
|
+
api_url: str = "https://os-api.agno.com"
|
|
20
20
|
|
|
21
21
|
model_config = SettingsConfigDict(env_prefix="AGNO_")
|
|
22
22
|
|
|
@@ -42,7 +42,7 @@ class AgnoAPISettings(BaseSettings):
|
|
|
42
42
|
elif api_runtime == "stg":
|
|
43
43
|
return "https://api-stg.agno.com"
|
|
44
44
|
else:
|
|
45
|
-
return "https://api.agno.com"
|
|
45
|
+
return "https://os-api.agno.com"
|
|
46
46
|
|
|
47
47
|
def gate_alpha_feature(self):
|
|
48
48
|
if not self.alpha_features:
|
agno/api/team.py
CHANGED
|
@@ -10,7 +10,7 @@ def create_team_run(run: TeamRunCreate) -> None:
|
|
|
10
10
|
try:
|
|
11
11
|
response = api_client.post(
|
|
12
12
|
ApiRoutes.RUN_CREATE,
|
|
13
|
-
json=
|
|
13
|
+
json=run.model_dump(exclude_none=True),
|
|
14
14
|
)
|
|
15
15
|
response.raise_for_status()
|
|
16
16
|
except Exception as e:
|
|
@@ -23,7 +23,7 @@ async def acreate_team_run(run: TeamRunCreate) -> None:
|
|
|
23
23
|
try:
|
|
24
24
|
response = await api_client.post(
|
|
25
25
|
ApiRoutes.RUN_CREATE,
|
|
26
|
-
json=
|
|
26
|
+
json=run.model_dump(exclude_none=True),
|
|
27
27
|
)
|
|
28
28
|
response.raise_for_status()
|
|
29
29
|
except Exception as e:
|
agno/db/dynamo/dynamo.py
CHANGED
|
@@ -506,8 +506,6 @@ class DynamoDb(BaseDb):
|
|
|
506
506
|
item = serialize_to_dynamo_item(serialized_session)
|
|
507
507
|
self.client.put_item(TableName=table_name, Item=item)
|
|
508
508
|
|
|
509
|
-
log_debug(f"Upserted session with id '{session.session_id}'")
|
|
510
|
-
|
|
511
509
|
return deserialize_session_result(serialized_session, session, deserialize)
|
|
512
510
|
|
|
513
511
|
except Exception as e:
|
|
@@ -852,8 +850,6 @@ class DynamoDb(BaseDb):
|
|
|
852
850
|
|
|
853
851
|
self.client.put_item(TableName=table_name, Item=item)
|
|
854
852
|
|
|
855
|
-
log_debug(f"Upserted user memory with id '{memory.memory_id}'")
|
|
856
|
-
|
|
857
853
|
if not deserialize:
|
|
858
854
|
return memory_dict
|
|
859
855
|
|
|
@@ -1530,8 +1526,6 @@ class DynamoDb(BaseDb):
|
|
|
1530
1526
|
|
|
1531
1527
|
self.client.put_item(TableName=table_name, Item=item)
|
|
1532
1528
|
|
|
1533
|
-
log_debug(f"Upserted knowledge content with id '{knowledge_row.id}'")
|
|
1534
|
-
|
|
1535
1529
|
return knowledge_row
|
|
1536
1530
|
|
|
1537
1531
|
except Exception as e:
|
agno/db/firestore/firestore.py
CHANGED
|
@@ -532,8 +532,6 @@ class FirestoreDb(BaseDb):
|
|
|
532
532
|
return None
|
|
533
533
|
deserialized_session = deserialize_session_json_fields(result)
|
|
534
534
|
|
|
535
|
-
log_debug(f"Upserted session with id '{session.session_id}'")
|
|
536
|
-
|
|
537
535
|
if not deserialize:
|
|
538
536
|
return deserialized_session
|
|
539
537
|
|
|
@@ -844,8 +842,6 @@ class FirestoreDb(BaseDb):
|
|
|
844
842
|
|
|
845
843
|
doc_ref.set(update_doc, merge=True)
|
|
846
844
|
|
|
847
|
-
log_debug(f"Upserted user memory with id '{memory.memory_id}'")
|
|
848
|
-
|
|
849
845
|
if not deserialize:
|
|
850
846
|
return update_doc
|
|
851
847
|
|
|
@@ -1170,8 +1166,6 @@ class FirestoreDb(BaseDb):
|
|
|
1170
1166
|
|
|
1171
1167
|
doc_ref.set(update_doc, merge=True)
|
|
1172
1168
|
|
|
1173
|
-
log_debug(f"Upserted knowledge source with id '{knowledge_row.id}'")
|
|
1174
|
-
|
|
1175
1169
|
return knowledge_row
|
|
1176
1170
|
|
|
1177
1171
|
except Exception as e:
|
|
@@ -280,8 +280,6 @@ class InMemoryDb(BaseDb):
|
|
|
280
280
|
session_dict["updated_at"] = session_dict.get("created_at")
|
|
281
281
|
self._sessions.append(session_dict)
|
|
282
282
|
|
|
283
|
-
log_debug(f"Upserted session with id '{session.session_id}'")
|
|
284
|
-
|
|
285
283
|
if not deserialize:
|
|
286
284
|
return session_dict
|
|
287
285
|
|
|
@@ -464,8 +462,6 @@ class InMemoryDb(BaseDb):
|
|
|
464
462
|
if not memory_updated:
|
|
465
463
|
self._memories.append(memory_dict)
|
|
466
464
|
|
|
467
|
-
log_debug(f"Upserted user memory with id '{memory.memory_id}'")
|
|
468
|
-
|
|
469
465
|
if not deserialize:
|
|
470
466
|
return memory_dict
|
|
471
467
|
return UserMemory.from_dict(memory_dict)
|
|
@@ -739,8 +735,6 @@ class InMemoryDb(BaseDb):
|
|
|
739
735
|
if not item_updated:
|
|
740
736
|
self._knowledge.append(knowledge_dict)
|
|
741
737
|
|
|
742
|
-
log_debug(f"Upserted knowledge source with id '{knowledge_row.id}'")
|
|
743
|
-
|
|
744
738
|
return knowledge_row
|
|
745
739
|
|
|
746
740
|
except Exception as e:
|
agno/db/json/json_db.py
CHANGED
|
@@ -375,8 +375,6 @@ class JsonDb(BaseDb):
|
|
|
375
375
|
|
|
376
376
|
self._write_json_file(self.session_table_name, sessions)
|
|
377
377
|
|
|
378
|
-
log_debug(f"Upserted session with id '{session.session_id}'")
|
|
379
|
-
|
|
380
378
|
if not deserialize:
|
|
381
379
|
return session_dict
|
|
382
380
|
|
|
@@ -580,8 +578,6 @@ class JsonDb(BaseDb):
|
|
|
580
578
|
|
|
581
579
|
self._write_json_file(self.memory_table_name, memories)
|
|
582
580
|
|
|
583
|
-
log_debug(f"Upserted user memory with id '{memory.memory_id}'")
|
|
584
|
-
|
|
585
581
|
if not deserialize:
|
|
586
582
|
return memory_dict
|
|
587
583
|
return UserMemory.from_dict(memory_dict)
|
|
@@ -874,8 +870,6 @@ class JsonDb(BaseDb):
|
|
|
874
870
|
|
|
875
871
|
self._write_json_file(self.knowledge_table_name, knowledge_items)
|
|
876
872
|
|
|
877
|
-
log_debug(f"Upserted knowledge source with id '{knowledge_row.id}'")
|
|
878
|
-
|
|
879
873
|
return knowledge_row
|
|
880
874
|
|
|
881
875
|
except Exception as e:
|
agno/db/mongo/mongo.py
CHANGED
|
@@ -504,8 +504,6 @@ class MongoDb(BaseDb):
|
|
|
504
504
|
|
|
505
505
|
session = deserialize_session_json_fields(result) # type: ignore
|
|
506
506
|
|
|
507
|
-
log_debug("Upserted session'")
|
|
508
|
-
|
|
509
507
|
if not deserialize:
|
|
510
508
|
return session
|
|
511
509
|
|
|
@@ -537,8 +535,6 @@ class MongoDb(BaseDb):
|
|
|
537
535
|
|
|
538
536
|
session = deserialize_session_json_fields(result) # type: ignore
|
|
539
537
|
|
|
540
|
-
log_debug(f"Upserted session with id '{session.session_id}'")
|
|
541
|
-
|
|
542
538
|
if not deserialize:
|
|
543
539
|
return session
|
|
544
540
|
|
|
@@ -570,8 +566,6 @@ class MongoDb(BaseDb):
|
|
|
570
566
|
|
|
571
567
|
session = deserialize_session_json_fields(result) # type: ignore
|
|
572
568
|
|
|
573
|
-
log_debug(f"Upserted session with id '{session.session_id}'")
|
|
574
|
-
|
|
575
569
|
if not deserialize:
|
|
576
570
|
return session
|
|
577
571
|
|
|
@@ -678,7 +672,9 @@ class MongoDb(BaseDb):
|
|
|
678
672
|
if result is None or not deserialize:
|
|
679
673
|
return result
|
|
680
674
|
|
|
681
|
-
|
|
675
|
+
# Remove MongoDB's _id field before creating UserMemory object
|
|
676
|
+
result_filtered = {k: v for k, v in result.items() if k != "_id"}
|
|
677
|
+
return UserMemory.from_dict(result_filtered)
|
|
682
678
|
|
|
683
679
|
except Exception as e:
|
|
684
680
|
log_error(f"Exception reading from collection: {e}")
|
|
@@ -756,7 +752,8 @@ class MongoDb(BaseDb):
|
|
|
756
752
|
if not deserialize:
|
|
757
753
|
return records, total_count
|
|
758
754
|
|
|
759
|
-
|
|
755
|
+
# Remove MongoDB's _id field before creating UserMemory objects
|
|
756
|
+
return [UserMemory.from_dict({k: v for k, v in record.items() if k != "_id"}) for record in records]
|
|
760
757
|
|
|
761
758
|
except Exception as e:
|
|
762
759
|
log_error(f"Exception reading from collection: {e}")
|
|
@@ -867,7 +864,9 @@ class MongoDb(BaseDb):
|
|
|
867
864
|
if not deserialize:
|
|
868
865
|
return update_doc
|
|
869
866
|
|
|
870
|
-
|
|
867
|
+
# Remove MongoDB's _id field before creating UserMemory object
|
|
868
|
+
update_doc_filtered = {k: v for k, v in update_doc.items() if k != "_id"}
|
|
869
|
+
return UserMemory.from_dict(update_doc_filtered)
|
|
871
870
|
|
|
872
871
|
except Exception as e:
|
|
873
872
|
log_error(f"Exception upserting user memory: {e}")
|
agno/db/mysql/utils.py
CHANGED
|
@@ -111,7 +111,6 @@ def is_valid_table(db_engine: Engine, table_name: str, table_type: str, db_schem
|
|
|
111
111
|
log_warning(f"Missing columns {missing_columns} in table {db_schema}.{table_name}")
|
|
112
112
|
return False
|
|
113
113
|
|
|
114
|
-
log_debug(f"Table {db_schema}.{table_name} has all expected columns")
|
|
115
114
|
return True
|
|
116
115
|
except Exception as e:
|
|
117
116
|
log_error(f"Error validating table schema for {db_schema}.{table_name}: {e}")
|
agno/db/postgres/postgres.py
CHANGED
|
@@ -610,8 +610,6 @@ class PostgresDb(BaseDb):
|
|
|
610
610
|
row = result.fetchone()
|
|
611
611
|
session_dict = dict(row._mapping)
|
|
612
612
|
|
|
613
|
-
log_debug(f"Upserted agent session with id '{session_dict.get('session_id')}'")
|
|
614
|
-
|
|
615
613
|
if session_dict is None or not deserialize:
|
|
616
614
|
return session_dict
|
|
617
615
|
return AgentSession.from_dict(session_dict)
|
|
@@ -648,8 +646,6 @@ class PostgresDb(BaseDb):
|
|
|
648
646
|
row = result.fetchone()
|
|
649
647
|
session_dict = dict(row._mapping)
|
|
650
648
|
|
|
651
|
-
log_debug(f"Upserted team session with id '{session_dict.get('session_id')}'")
|
|
652
|
-
|
|
653
649
|
if session_dict is None or not deserialize:
|
|
654
650
|
return session_dict
|
|
655
651
|
return TeamSession.from_dict(session_dict)
|
|
@@ -686,8 +682,6 @@ class PostgresDb(BaseDb):
|
|
|
686
682
|
row = result.fetchone()
|
|
687
683
|
session_dict = dict(row._mapping)
|
|
688
684
|
|
|
689
|
-
log_debug(f"Upserted workflow session with id '{session_dict.get('session_id')}'")
|
|
690
|
-
|
|
691
685
|
if session_dict is None or not deserialize:
|
|
692
686
|
return session_dict
|
|
693
687
|
return WorkflowSession.from_dict(session_dict)
|
|
@@ -1033,8 +1027,6 @@ class PostgresDb(BaseDb):
|
|
|
1033
1027
|
|
|
1034
1028
|
memory_raw = dict(row._mapping)
|
|
1035
1029
|
|
|
1036
|
-
log_debug(f"Upserted user memory with id '{memory.memory_id}'")
|
|
1037
|
-
|
|
1038
1030
|
if not memory_raw or not deserialize:
|
|
1039
1031
|
return memory_raw
|
|
1040
1032
|
|
|
@@ -1405,8 +1397,6 @@ class PostgresDb(BaseDb):
|
|
|
1405
1397
|
)
|
|
1406
1398
|
sess.execute(stmt)
|
|
1407
1399
|
|
|
1408
|
-
log_debug(f"Upserted knowledge row with id '{knowledge_row.id}'")
|
|
1409
|
-
|
|
1410
1400
|
return knowledge_row
|
|
1411
1401
|
|
|
1412
1402
|
except Exception as e:
|
agno/db/postgres/utils.py
CHANGED
|
@@ -107,7 +107,6 @@ def is_valid_table(db_engine: Engine, table_name: str, table_type: str, db_schem
|
|
|
107
107
|
log_warning(f"Missing columns {missing_columns} in table {db_schema}.{table_name}")
|
|
108
108
|
return False
|
|
109
109
|
|
|
110
|
-
log_debug(f"Table {db_schema}.{table_name} has all expected columns")
|
|
111
110
|
return True
|
|
112
111
|
except Exception as e:
|
|
113
112
|
log_error(f"Error validating table schema for {db_schema}.{table_name}: {e}")
|
agno/db/redis/redis.py
CHANGED
|
@@ -572,8 +572,6 @@ class RedisDb(BaseDb):
|
|
|
572
572
|
if not success:
|
|
573
573
|
return None
|
|
574
574
|
|
|
575
|
-
log_debug(f"Upserted session with id '{session.session_id}'")
|
|
576
|
-
|
|
577
575
|
if not deserialize:
|
|
578
576
|
return data
|
|
579
577
|
|
|
@@ -1140,8 +1138,6 @@ class RedisDb(BaseDb):
|
|
|
1140
1138
|
data = knowledge_row.model_dump()
|
|
1141
1139
|
success = self._store_record("knowledge", knowledge_row.id, data) # type: ignore
|
|
1142
1140
|
|
|
1143
|
-
log_debug(f"Upserted knowledge content with id '{knowledge_row.id}'")
|
|
1144
|
-
|
|
1145
1141
|
return knowledge_row if success else None
|
|
1146
1142
|
|
|
1147
1143
|
except Exception as e:
|
|
@@ -697,8 +697,6 @@ class SingleStoreDb(BaseDb):
|
|
|
697
697
|
if row is None:
|
|
698
698
|
return None
|
|
699
699
|
|
|
700
|
-
log_debug(f"Upserted session with id '{session_dict.get('session_id')}'")
|
|
701
|
-
|
|
702
700
|
if not deserialize:
|
|
703
701
|
return row._mapping
|
|
704
702
|
|
|
@@ -740,8 +738,6 @@ class SingleStoreDb(BaseDb):
|
|
|
740
738
|
if row is None:
|
|
741
739
|
return None
|
|
742
740
|
|
|
743
|
-
log_debug(f"Upserted session with id '{session_dict.get('session_id')}'")
|
|
744
|
-
|
|
745
741
|
if not deserialize:
|
|
746
742
|
return row._mapping
|
|
747
743
|
|
|
@@ -783,8 +779,6 @@ class SingleStoreDb(BaseDb):
|
|
|
783
779
|
if row is None:
|
|
784
780
|
return None
|
|
785
781
|
|
|
786
|
-
log_debug(f"Upserted session with id '{session_dict.get('session_id')}'")
|
|
787
|
-
|
|
788
782
|
if not deserialize:
|
|
789
783
|
return row._mapping
|
|
790
784
|
|
|
@@ -1117,8 +1111,6 @@ class SingleStoreDb(BaseDb):
|
|
|
1117
1111
|
if row is None:
|
|
1118
1112
|
return None
|
|
1119
1113
|
|
|
1120
|
-
log_debug(f"Upserted user memory with id '{memory.memory_id}'")
|
|
1121
|
-
|
|
1122
1114
|
memory_raw = row._mapping
|
|
1123
1115
|
if not memory_raw or not deserialize:
|
|
1124
1116
|
return memory_raw
|
|
@@ -1461,8 +1453,6 @@ class SingleStoreDb(BaseDb):
|
|
|
1461
1453
|
stmt = stmt.on_duplicate_key_update(**update_fields)
|
|
1462
1454
|
sess.execute(stmt)
|
|
1463
1455
|
|
|
1464
|
-
log_debug(f"Upserted knowledge source with id '{knowledge_row.id}'")
|
|
1465
|
-
|
|
1466
1456
|
return knowledge_row
|
|
1467
1457
|
|
|
1468
1458
|
except Exception as e:
|
agno/db/singlestore/utils.py
CHANGED
|
@@ -133,7 +133,6 @@ def is_valid_table(db_engine: Engine, table_name: str, table_type: str, db_schem
|
|
|
133
133
|
log_warning(f"Missing columns {missing_columns} in table {table_ref}")
|
|
134
134
|
return False
|
|
135
135
|
|
|
136
|
-
log_debug(f"Table {table_ref} has all expected columns")
|
|
137
136
|
return True
|
|
138
137
|
|
|
139
138
|
except Exception as e:
|
agno/db/sqlite/sqlite.py
CHANGED
|
@@ -995,8 +995,6 @@ class SqliteDb(BaseDb):
|
|
|
995
995
|
if row is None:
|
|
996
996
|
return None
|
|
997
997
|
|
|
998
|
-
log_debug(f"Upserted user memory with id '{memory.memory_id}'")
|
|
999
|
-
|
|
1000
998
|
memory_raw = row._mapping
|
|
1001
999
|
if not memory_raw or not deserialize:
|
|
1002
1000
|
return memory_raw
|
|
@@ -1358,8 +1356,6 @@ class SqliteDb(BaseDb):
|
|
|
1358
1356
|
)
|
|
1359
1357
|
sess.execute(stmt)
|
|
1360
1358
|
|
|
1361
|
-
log_debug(f"Upserted knowledge content with id '{knowledge_row.id}'")
|
|
1362
|
-
|
|
1363
1359
|
return knowledge_row
|
|
1364
1360
|
|
|
1365
1361
|
except Exception as e:
|
agno/db/sqlite/utils.py
CHANGED
|
@@ -91,7 +91,6 @@ def is_valid_table(db_engine: Engine, table_name: str, table_type: str, db_schem
|
|
|
91
91
|
log_warning(f"Missing columns {missing_columns} in table {table_name}")
|
|
92
92
|
return False
|
|
93
93
|
|
|
94
|
-
log_debug(f"Table {table_name} has all expected columns")
|
|
95
94
|
return True
|
|
96
95
|
except Exception as e:
|
|
97
96
|
log_error(f"Error validating table schema for {table_name}: {e}")
|
agno/eval/accuracy.py
CHANGED
|
@@ -97,11 +97,18 @@ class AccuracyResult:
|
|
|
97
97
|
title_justify="center",
|
|
98
98
|
)
|
|
99
99
|
summary_table.add_row("Number of Runs", f"{len(self.results)}")
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
|
|
101
|
+
if self.avg_score is not None:
|
|
102
|
+
summary_table.add_row("Average Score", f"{self.avg_score:.2f}")
|
|
103
|
+
if self.mean_score is not None:
|
|
104
|
+
summary_table.add_row("Mean Score", f"{self.mean_score:.2f}")
|
|
105
|
+
if self.min_score is not None:
|
|
106
|
+
summary_table.add_row("Minimum Score", f"{self.min_score:.2f}")
|
|
107
|
+
if self.max_score is not None:
|
|
108
|
+
summary_table.add_row("Maximum Score", f"{self.max_score:.2f}")
|
|
109
|
+
if self.std_dev_score is not None:
|
|
110
|
+
summary_table.add_row("Standard Deviation", f"{self.std_dev_score:.2f}")
|
|
111
|
+
|
|
105
112
|
console.print(summary_table)
|
|
106
113
|
|
|
107
114
|
def print_results(self, console: Optional["Console"] = None):
|
|
@@ -8,6 +8,7 @@ from agno.agent.agent import Agent, RunOutput
|
|
|
8
8
|
from agno.media import Audio, File, Image, Video
|
|
9
9
|
from agno.team.team import Team, TeamRunOutput
|
|
10
10
|
from agno.utils.log import log_info, log_warning
|
|
11
|
+
from agno.utils.message import get_text_from_message
|
|
11
12
|
|
|
12
13
|
try:
|
|
13
14
|
import discord
|
|
@@ -167,7 +168,10 @@ class DiscordClient:
|
|
|
167
168
|
thread=thread, message=f"Reasoning: \n{response.reasoning_content}", italics=True
|
|
168
169
|
)
|
|
169
170
|
|
|
170
|
-
|
|
171
|
+
# Handle structured outputs properly
|
|
172
|
+
content_message = get_text_from_message(response.content) if response.content is not None else ""
|
|
173
|
+
|
|
174
|
+
await self._send_discord_messages(thread=thread, message=content_message)
|
|
171
175
|
|
|
172
176
|
async def _send_discord_messages(self, thread: discord.channel, message: str, italics: bool = False): # type: ignore
|
|
173
177
|
if len(message) < 1500:
|
|
@@ -35,13 +35,13 @@ class ChunkingStrategy(ABC):
|
|
|
35
35
|
class ChunkingStrategyType(str, Enum):
|
|
36
36
|
"""Enumeration of available chunking strategies."""
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
AGENTIC_CHUNKER = "AgenticChunker"
|
|
39
|
+
DOCUMENT_CHUNKER = "DocumentChunker"
|
|
40
|
+
RECURSIVE_CHUNKER = "RecursiveChunker"
|
|
41
|
+
SEMANTIC_CHUNKER = "SemanticChunker"
|
|
42
|
+
FIXED_SIZE_CHUNKER = "FixedSizeChunker"
|
|
43
|
+
ROW_CHUNKER = "RowChunker"
|
|
44
|
+
MARKDOWN_CHUNKER = "MarkdownChunker"
|
|
45
45
|
|
|
46
46
|
@classmethod
|
|
47
47
|
def from_string(cls, strategy_name: str) -> "ChunkingStrategyType":
|
|
@@ -63,13 +63,13 @@ class ChunkingStrategyFactory:
|
|
|
63
63
|
def create_strategy(cls, strategy_type: ChunkingStrategyType, **kwargs) -> ChunkingStrategy:
|
|
64
64
|
"""Create an instance of the chunking strategy with the given parameters."""
|
|
65
65
|
strategy_map = {
|
|
66
|
-
ChunkingStrategyType.
|
|
67
|
-
ChunkingStrategyType.
|
|
68
|
-
ChunkingStrategyType.
|
|
69
|
-
ChunkingStrategyType.
|
|
70
|
-
ChunkingStrategyType.
|
|
71
|
-
ChunkingStrategyType.
|
|
72
|
-
ChunkingStrategyType.
|
|
66
|
+
ChunkingStrategyType.AGENTIC_CHUNKER: cls._create_agentic_chunking,
|
|
67
|
+
ChunkingStrategyType.DOCUMENT_CHUNKER: cls._create_document_chunking,
|
|
68
|
+
ChunkingStrategyType.RECURSIVE_CHUNKER: cls._create_recursive_chunking,
|
|
69
|
+
ChunkingStrategyType.SEMANTIC_CHUNKER: cls._create_semantic_chunking,
|
|
70
|
+
ChunkingStrategyType.FIXED_SIZE_CHUNKER: cls._create_fixed_chunking,
|
|
71
|
+
ChunkingStrategyType.ROW_CHUNKER: cls._create_row_chunking,
|
|
72
|
+
ChunkingStrategyType.MARKDOWN_CHUNKER: cls._create_markdown_chunking,
|
|
73
73
|
}
|
|
74
74
|
return strategy_map[strategy_type](**kwargs)
|
|
75
75
|
|
|
@@ -272,7 +272,7 @@ class AwsBedrockEmbedder(Embedder):
|
|
|
272
272
|
contentType="application/json",
|
|
273
273
|
accept="application/json",
|
|
274
274
|
)
|
|
275
|
-
response_body = json.loads(response["body"].read().decode("utf-8"))
|
|
275
|
+
response_body = json.loads((await response["body"].read()).decode("utf-8"))
|
|
276
276
|
|
|
277
277
|
# Extract embeddings using the same logic as get_embedding
|
|
278
278
|
if "embeddings" in response_body:
|
|
@@ -308,7 +308,7 @@ class AwsBedrockEmbedder(Embedder):
|
|
|
308
308
|
contentType="application/json",
|
|
309
309
|
accept="application/json",
|
|
310
310
|
)
|
|
311
|
-
response_body = json.loads(response["body"].read().decode("utf-8"))
|
|
311
|
+
response_body = json.loads((await response["body"].read()).decode("utf-8"))
|
|
312
312
|
|
|
313
313
|
embedding: List[float] = []
|
|
314
314
|
# Extract embeddings using the same logic as get_embedding_and_usage
|