Skip to content

Rename followUpQuestions -> followUpSuggestions #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion text_2_sql/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Text2Sql__DatabaseEngine=<DatabaseEngine> # TSQL or Postgres or Snowflake or Dat
Text2Sql__UseQueryCache=<Determines if the Query Cache will be used to speed up query generation. Defaults to True.> # True or False
Text2Sql__PreRunQueryCache=<Determines if the results from the Query Cache will be pre-run to speed up answer generation. Defaults to True.> # True or False
Text2Sql__UseColumnValueStore=<Determines if the Column Value Store will be used for schema selection Defaults to True.> # True or False
Text2Sql__GenerateFollowUpQuestions=<Determines if follow up questions will be generated. Defaults to True.> # True or False
Text2Sql__GenerateFollowUpSuggestions=<Determines if follow up questions will be generated. Defaults to True.> # True or False

# Open AI Connection Details
OpenAI__CompletionDeployment=<openAICompletionDeploymentId. Used for data dictionary creator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def __init__(self, state_store: StateStore, **kwargs):

self._agentic_flow = None

self._generate_follow_up_questions = (
os.environ.get("Text2Sql__GenerateFollowUpQuestions", "True").lower()
self._generate_follow_up_suggestions = (
os.environ.get("Text2Sql__GenerateFollowUpSuggestions", "True").lower()
== "true"
)

Expand All @@ -62,9 +62,9 @@ def get_all_agents(self):

parallel_query_solving_agent = ParallelQuerySolvingAgent(**self.kwargs)

if self._generate_follow_up_questions:
if self._generate_follow_up_suggestions:
answer_agent = LLMAgentCreator.create(
"answer_with_follow_up_questions_agent", **self.kwargs
"answer_with_follow_up_suggestions_agent", **self.kwargs
)
else:
answer_agent = LLMAgentCreator.create("answer_agent", **self.kwargs)
Expand All @@ -82,7 +82,7 @@ def termination_condition(self):
"""Define the termination condition for the chat."""
termination = (
SourceMatchTermination("answer_agent")
| SourceMatchTermination("answer_with_follow_up_questions_agent")
| SourceMatchTermination("answer_with_follow_up_suggestions_agent")
# | TextMentionTermination(
# "[]",
# sources=["user_message_rewrite_agent"],
Expand Down Expand Up @@ -110,9 +110,9 @@ def unified_selector(self, messages):
# Handle transition after parallel query solving
elif (
current_agent == "parallel_query_solving_agent"
and self._generate_follow_up_questions
and self._generate_follow_up_suggestions
):
decision = "answer_with_follow_up_questions_agent"
decision = "answer_with_follow_up_suggestions_agent"
elif current_agent == "parallel_query_solving_agent":
decision = "answer_agent"

Expand Down Expand Up @@ -325,7 +325,7 @@ async def process_user_message(
)
elif (
message.source == "answer_agent"
or message.source == "answer_with_follow_up_questions_agent"
or message.source == "answer_with_follow_up_suggestions_agent"
):
payload = ProcessingUpdatePayload(
message="Generating the answer...",
Expand All @@ -338,7 +338,7 @@ async def process_user_message(
if (
message.messages[-1].source == "answer_agent"
or message.messages[-1].source
== "answer_with_follow_up_questions_agent"
== "answer_with_follow_up_suggestions_agent"
):
# If the message is from the answer_agent, we need to return the final answer
payload = self.extract_answer_payload(message.messages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import logging
from text_2_sql_core.structured_outputs import (
AnswerAgentOutput,
AnswerWithFollowUpQuestionsAgentOutput,
AnswerWithFollowUpSuggestionsAgentOutput,
UserMessageRewriteAgentOutput,
)
from autogen_core.model_context import BufferedChatCompletionContext
Expand Down Expand Up @@ -117,8 +117,8 @@ def create(cls, name: str, **kwargs) -> AssistantAgent:
# Import the structured output agent
if name == "answer_agent":
structured_output = AnswerAgentOutput
elif name == "answer_with_follow_up_questions_agent":
structured_output = AnswerWithFollowUpQuestionsAgentOutput
elif name == "answer_with_follow_up_suggestions_agent":
structured_output = AnswerWithFollowUpSuggestionsAgentOutput
elif name == "user_message_rewrite_agent":
structured_output = UserMessageRewriteAgentOutput

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class Source(InteractionPayloadBase):
answer: str
steps: list[list[str]] = Field(default_factory=list, alias="Steps")
sources: list[Source] = Field(default_factory=list)
follow_up_questions: list[str] | None = Field(
default=None, alias="followUpQuestions"
follow_up_suggestions: list[str] | None = Field(
default=None, alias="followUpSuggestions"
)

payload_type: Literal[PayloadType.ANSWER_WITH_SOURCES] = Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ system_message: |
<output>
{
"answer": "The response to the user's question.",
"follow_up_questions": [
"follow_up_suggestions": [
"Follow-up question 1",
"Follow-up question 2",
"Follow-up question 3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from text_2_sql_core.structured_outputs.user_message_rewrite_agent import (
UserMessageRewriteAgentOutput,
)
from text_2_sql_core.structured_outputs.answer_with_follow_up_questions_agent import (
AnswerWithFollowUpQuestionsAgentOutput,
from text_2_sql_core.structured_outputs.answer_with_follow_up_suggestions_agent import (
AnswerWithFollowUpSuggestionsAgentOutput,
)
from text_2_sql_core.structured_outputs.answer_agent import AnswerAgentOutput

__all__ = [
"AnswerAgentOutput",
"AnswerWithFollowUpQuestionsAgentOutput",
"AnswerWithFollowUpSuggestionsAgentOutput",
"SQLSchemaSelectionAgentOutput",
"UserMessageRewriteAgentOutput",
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pydantic import BaseModel


class AnswerWithFollowUpQuestionsAgentOutput(BaseModel):
class AnswerWithFollowUpSuggestionsAgentOutput(BaseModel):
"""The output of the answer agent with follow up questions."""

answer: str
follow_up_questions: list[str]
follow_up_suggestions: list[str]
Loading