Skip to content

Commit 8aeb38c

Browse files
committed
Rename to llm agents
1 parent d1f24cf commit 8aeb38c

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

text_2_sql/autogen/agentic_text_2_sql.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
from autogen_agentchat.task import TextMentionTermination
1+
from autogen_agentchat.task import TextMentionTermination, MaxMessageTermination
22
from autogen_agentchat.teams import SelectorGroupChat
33
from utils.models import MINI_MODEL
4-
from utils.agent_creator import AgentCreator
4+
from utils.llm_agent_creator import LLMAgentCreator
55
from autogen_core.components.models import FunctionExecutionResult
66
import logging
77

8-
SQL_QUERY_GENERATION_AGENT = AgentCreator.create(
8+
SQL_QUERY_GENERATION_AGENT = LLMAgentCreator.create(
99
"sql_query_generation_agent",
1010
target_engine="Microsoft SQL Server",
1111
engine_specific_rules="Use TOP X to limit the number of rows returned instead of LIMIT X. NEVER USE LIMIT X as it produces a syntax error.",
1212
)
13-
SQL_SCHEMA_SELECTION_AGENT = AgentCreator.create("sql_schema_selection_agent")
14-
SQL_QUERY_CORRECTION_AGENT = AgentCreator.create(
13+
SQL_SCHEMA_SELECTION_AGENT = LLMAgentCreator.create("sql_schema_selection_agent")
14+
SQL_QUERY_CORRECTION_AGENT = LLMAgentCreator.create(
1515
"sql_query_correction_agent",
1616
target_engine="Microsoft SQL Server",
1717
engine_specific_rules="Use TOP X to limit the number of rows returned instead of LIMIT X. NEVER USE LIMIT X as it produces a syntax error.",
1818
)
19-
SQL_QUERY_CACHE_AGENT = AgentCreator.create("sql_query_cache_agent")
20-
ANSWER_AGENT = AgentCreator.create("answer_agent")
21-
QUESTION_DECOMPOSITION_AGENT = AgentCreator.create("question_decomposition_agent")
19+
SQL_QUERY_CACHE_AGENT = LLMAgentCreator.create("sql_query_cache_agent")
20+
ANSWER_AGENT = LLMAgentCreator.create("answer_agent")
21+
QUESTION_DECOMPOSITION_AGENT = LLMAgentCreator.create("question_decomposition_agent")
2222

2323

2424
def text_2_sql_generator_selector_func(messages):
@@ -51,7 +51,7 @@ def text_2_sql_generator_selector_func(messages):
5151
return None
5252

5353

54-
termination = TextMentionTermination("TERMINATE")
54+
termination = TextMentionTermination("TERMINATE") | MaxMessageTermination(10)
5555
text_2_sql_generator = SelectorGroupChat(
5656
[
5757
SQL_QUERY_GENERATION_AGENT,
File renamed without changes.

text_2_sql/autogen/agents/question_decomposition_agent.yaml renamed to text_2_sql/autogen/llm_agents/question_decomposition_agent.yaml

File renamed without changes.

text_2_sql/autogen/agents/sql_query_cache_agent.yaml renamed to text_2_sql/autogen/llm_agents/sql_query_cache_agent.yaml

File renamed without changes.

text_2_sql/autogen/agents/sql_query_correction_agent.yaml renamed to text_2_sql/autogen/llm_agents/sql_query_correction_agent.yaml

File renamed without changes.

text_2_sql/autogen/agents/sql_query_generation_agent.yaml renamed to text_2_sql/autogen/llm_agents/sql_query_generation_agent.yaml

File renamed without changes.

text_2_sql/autogen/agents/sql_schema_selection_agent.yaml renamed to text_2_sql/autogen/llm_agents/sql_schema_selection_agent.yaml

File renamed without changes.

text_2_sql/autogen/utils/agent_creator.py renamed to text_2_sql/autogen/utils/llm_agent_creator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from jinja2 import Template
1111

1212

13-
class AgentCreator:
13+
class LLMAgentCreator:
1414
@classmethod
1515
def load_agent_file(cls, name):
1616
with open(f"agents/{name.lower()}.yaml", "r") as file:

0 commit comments

Comments
 (0)