Skip to content

Commit 986d00e

Browse files
authored
Deletes old context_transfer assistants (#581)
Additionally improves "assistant_card" response to include available assistant services and templates if the model provides invalid ones.
1 parent 9a535d9 commit 986d00e

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

assistants/navigator-assistant/assistant/response/local_tool/add_assistant_to_conversation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ async def assistant_card(args: ArgumentModel, context: ConversationContext) -> s
5454
args.assistant_service_id,
5555
args.template_id,
5656
)
57-
return "Error: The selected assistant_service_id and template_id are not available."
57+
return (
58+
"Error: The selected assistant_service_id and template_id are not available. For reference, the available assistants are:\n\n"
59+
+ "\n\n".join([
60+
f"assistant_service_id: {assistant_service_id}, template_id: {template.id}\nname: {template.name}\n\n"
61+
for assistant_service_id, template, _ in service_templates
62+
])
63+
)
5864

5965
await context.send_messages(
6066
NewConversationMessage(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""delete context transfer assistants
2+
3+
Revision ID: b2f86e981885
4+
Revises: 3763629295ad
5+
Create Date: 2025-05-19 16:36:13.739217
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
from alembic import op
12+
13+
# revision identifiers, used by Alembic.
14+
revision: str = "b2f86e981885"
15+
down_revision: Union[str, None] = "3763629295ad"
16+
branch_labels: Union[str, Sequence[str], None] = None
17+
depends_on: Union[str, Sequence[str], None] = None
18+
19+
20+
def upgrade() -> None:
21+
op.execute(
22+
"""
23+
DELETE FROM assistant
24+
WHERE assistant_service_id = 'project-assistant.made-exploration'
25+
AND template_id = 'context_transfer'
26+
"""
27+
)
28+
op.execute(
29+
"""
30+
UPDATE assistantparticipant
31+
SET active_participant = false
32+
WHERE assistant_id NOT IN (
33+
SELECT assistant_id
34+
FROM assistant
35+
)
36+
"""
37+
)
38+
39+
40+
def downgrade() -> None:
41+
pass

0 commit comments

Comments
 (0)