agno 2.4.0__py3-none-any.whl → 2.4.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.
- agno/db/postgres/postgres.py +25 -12
- agno/db/sqlite/sqlite.py +24 -11
- agno/integrations/discord/client.py +12 -1
- agno/knowledge/knowledge.py +1070 -43
- agno/knowledge/reader/csv_reader.py +231 -8
- agno/knowledge/reader/field_labeled_csv_reader.py +167 -3
- agno/knowledge/reader/reader_factory.py +8 -1
- agno/knowledge/remote_content/__init__.py +29 -0
- agno/knowledge/remote_content/config.py +204 -0
- agno/knowledge/remote_content/remote_content.py +74 -17
- agno/models/base.py +12 -2
- agno/models/cerebras/cerebras.py +34 -2
- agno/models/n1n/__init__.py +3 -0
- agno/models/n1n/n1n.py +57 -0
- agno/models/openai/chat.py +18 -1
- agno/models/perplexity/perplexity.py +2 -0
- agno/os/interfaces/slack/router.py +10 -1
- agno/os/interfaces/whatsapp/router.py +6 -0
- agno/os/routers/components/components.py +10 -1
- agno/os/routers/knowledge/knowledge.py +125 -0
- agno/os/routers/knowledge/schemas.py +12 -0
- agno/run/agent.py +2 -0
- agno/team/team.py +20 -4
- agno/vectordb/pgvector/pgvector.py +3 -3
- {agno-2.4.0.dist-info → agno-2.4.1.dist-info}/METADATA +4 -1
- {agno-2.4.0.dist-info → agno-2.4.1.dist-info}/RECORD +29 -26
- {agno-2.4.0.dist-info → agno-2.4.1.dist-info}/WHEEL +1 -1
- {agno-2.4.0.dist-info → agno-2.4.1.dist-info}/licenses/LICENSE +0 -0
- {agno-2.4.0.dist-info → agno-2.4.1.dist-info}/top_level.txt +0 -0
agno/db/postgres/postgres.py
CHANGED
|
@@ -3593,7 +3593,7 @@ class PostgresDb(BaseDb):
|
|
|
3593
3593
|
|
|
3594
3594
|
Args:
|
|
3595
3595
|
component_id: The component ID.
|
|
3596
|
-
version: Specific version number. If None, uses current.
|
|
3596
|
+
version: Specific version number. If None, uses current or latest draft.
|
|
3597
3597
|
label: Config label to lookup. Ignored if version is provided.
|
|
3598
3598
|
|
|
3599
3599
|
Returns:
|
|
@@ -3607,17 +3607,23 @@ class PostgresDb(BaseDb):
|
|
|
3607
3607
|
return None
|
|
3608
3608
|
|
|
3609
3609
|
with self.Session() as sess:
|
|
3610
|
-
#
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
components_table.c.component_id
|
|
3614
|
-
|
|
3610
|
+
# Verify component exists and get current_version
|
|
3611
|
+
component_row = (
|
|
3612
|
+
sess.execute(
|
|
3613
|
+
select(components_table.c.component_id, components_table.c.current_version).where(
|
|
3614
|
+
components_table.c.component_id == component_id,
|
|
3615
|
+
components_table.c.deleted_at.is_(None),
|
|
3616
|
+
)
|
|
3615
3617
|
)
|
|
3616
|
-
|
|
3618
|
+
.mappings()
|
|
3619
|
+
.one_or_none()
|
|
3620
|
+
)
|
|
3617
3621
|
|
|
3618
|
-
if
|
|
3622
|
+
if component_row is None:
|
|
3619
3623
|
return None
|
|
3620
3624
|
|
|
3625
|
+
current_version = component_row["current_version"]
|
|
3626
|
+
|
|
3621
3627
|
if version is not None:
|
|
3622
3628
|
stmt = select(configs_table).where(
|
|
3623
3629
|
configs_table.c.component_id == component_id,
|
|
@@ -3628,12 +3634,19 @@ class PostgresDb(BaseDb):
|
|
|
3628
3634
|
configs_table.c.component_id == component_id,
|
|
3629
3635
|
configs_table.c.label == label,
|
|
3630
3636
|
)
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
return None
|
|
3637
|
+
elif current_version is not None:
|
|
3638
|
+
# Use the current published version
|
|
3634
3639
|
stmt = select(configs_table).where(
|
|
3635
3640
|
configs_table.c.component_id == component_id,
|
|
3636
|
-
configs_table.c.version ==
|
|
3641
|
+
configs_table.c.version == current_version,
|
|
3642
|
+
)
|
|
3643
|
+
else:
|
|
3644
|
+
# No current_version set (draft only) - get the latest version
|
|
3645
|
+
stmt = (
|
|
3646
|
+
select(configs_table)
|
|
3647
|
+
.where(configs_table.c.component_id == component_id)
|
|
3648
|
+
.order_by(configs_table.c.version.desc())
|
|
3649
|
+
.limit(1)
|
|
3637
3650
|
)
|
|
3638
3651
|
|
|
3639
3652
|
row = sess.execute(stmt).mappings().one_or_none()
|
agno/db/sqlite/sqlite.py
CHANGED
|
@@ -3475,7 +3475,7 @@ class SqliteDb(BaseDb):
|
|
|
3475
3475
|
|
|
3476
3476
|
Args:
|
|
3477
3477
|
component_id: The component ID.
|
|
3478
|
-
version: Specific version number. If None, uses current.
|
|
3478
|
+
version: Specific version number. If None, uses current or latest draft.
|
|
3479
3479
|
label: Config label to lookup. Ignored if version is provided.
|
|
3480
3480
|
|
|
3481
3481
|
Returns:
|
|
@@ -3490,16 +3490,22 @@ class SqliteDb(BaseDb):
|
|
|
3490
3490
|
|
|
3491
3491
|
with self.Session() as sess:
|
|
3492
3492
|
# Always verify component exists and is not deleted
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
components_table.c.
|
|
3496
|
-
|
|
3493
|
+
component_row = (
|
|
3494
|
+
sess.execute(
|
|
3495
|
+
select(components_table.c.current_version, components_table.c.component_id).where(
|
|
3496
|
+
components_table.c.component_id == component_id,
|
|
3497
|
+
components_table.c.deleted_at.is_(None),
|
|
3498
|
+
)
|
|
3497
3499
|
)
|
|
3498
|
-
|
|
3500
|
+
.mappings()
|
|
3501
|
+
.one_or_none()
|
|
3502
|
+
)
|
|
3499
3503
|
|
|
3500
|
-
if
|
|
3504
|
+
if component_row is None:
|
|
3501
3505
|
return None
|
|
3502
3506
|
|
|
3507
|
+
current_version = component_row["current_version"]
|
|
3508
|
+
|
|
3503
3509
|
if version is not None:
|
|
3504
3510
|
stmt = select(configs_table).where(
|
|
3505
3511
|
configs_table.c.component_id == component_id,
|
|
@@ -3510,12 +3516,19 @@ class SqliteDb(BaseDb):
|
|
|
3510
3516
|
configs_table.c.component_id == component_id,
|
|
3511
3517
|
configs_table.c.label == label,
|
|
3512
3518
|
)
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
return None
|
|
3519
|
+
elif current_version is not None:
|
|
3520
|
+
# Use the current published version
|
|
3516
3521
|
stmt = select(configs_table).where(
|
|
3517
3522
|
configs_table.c.component_id == component_id,
|
|
3518
|
-
configs_table.c.version ==
|
|
3523
|
+
configs_table.c.version == current_version,
|
|
3524
|
+
)
|
|
3525
|
+
else:
|
|
3526
|
+
# No current_version set (draft only) - get the latest version
|
|
3527
|
+
stmt = (
|
|
3528
|
+
select(configs_table)
|
|
3529
|
+
.where(configs_table.c.component_id == component_id)
|
|
3530
|
+
.order_by(configs_table.c.version.desc())
|
|
3531
|
+
.limit(1)
|
|
3519
3532
|
)
|
|
3520
3533
|
|
|
3521
3534
|
result = sess.execute(stmt).fetchone()
|
|
@@ -7,7 +7,7 @@ import requests
|
|
|
7
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
|
-
from agno.utils.log import log_info, log_warning
|
|
10
|
+
from agno.utils.log import log_error, log_info, log_warning
|
|
11
11
|
from agno.utils.message import get_text_from_message
|
|
12
12
|
|
|
13
13
|
try:
|
|
@@ -126,6 +126,11 @@ class DiscordClient:
|
|
|
126
126
|
audio=[Audio(url=message_audio)] if message_audio else None,
|
|
127
127
|
files=[File(content=message_file)] if message_file else None,
|
|
128
128
|
)
|
|
129
|
+
if agent_response.status == "ERROR":
|
|
130
|
+
log_error(agent_response.content)
|
|
131
|
+
agent_response.content = (
|
|
132
|
+
"Sorry, there was an error processing your message. Please try again later."
|
|
133
|
+
)
|
|
129
134
|
await self._handle_response_in_thread(agent_response, thread)
|
|
130
135
|
elif self.team:
|
|
131
136
|
self.team.additional_context = additional_context
|
|
@@ -138,6 +143,12 @@ class DiscordClient:
|
|
|
138
143
|
audio=[Audio(url=message_audio)] if message_audio else None,
|
|
139
144
|
files=[File(content=message_file)] if message_file else None,
|
|
140
145
|
)
|
|
146
|
+
if team_response.status == "ERROR":
|
|
147
|
+
log_error(team_response.content)
|
|
148
|
+
team_response.content = (
|
|
149
|
+
"Sorry, there was an error processing your message. Please try again later."
|
|
150
|
+
)
|
|
151
|
+
|
|
141
152
|
await self._handle_response_in_thread(team_response, thread)
|
|
142
153
|
|
|
143
154
|
async def handle_hitl(
|