Skip to content

Commit

Permalink
Increasing the step limit (#256)
Browse files Browse the repository at this point in the history
* Increasing the step limit

* DH-5017/ increase the step limit

* DH-5017/ updating the max iterations steps of agent
  • Loading branch information
MohammadrezaPourreza authored Nov 20, 2023
1 parent b81e7e0 commit 8955b29
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ OPENAI_API_KEY = #This field is required for the engine to work.
ORG_ID =
LLM_MODEL = 'gpt-4-1106-preview' #the openAI llm model that you want to use. possible values: gpt-4-1106-preview.

# All of our SQL generation agents are using different tools to generate SQL queries, in order to limit the number of times that agents can
# use different tools you can set the "AGENT_MAX_ITERATIONS" env variable. By default it is set to 20 iterations.

FINETUNED_MODEL = '' # The id of the LLM model you fine-tuned and you want to use inside DataheraldFinetuningAgent agent.

DH_ENGINE_TIMEOUT = #timeout in seconds for the engine to return a response
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ ORG_ID =
#Encryption key for storing DB connection data in Mongo
ENCRYPT_KEY =
# All of our SQL generation agents are using different tools to generate SQL queries, in order to limit the number of times that agents can
# use different tools you can set the "AGENT_MAX_ITERATIONS" env variable. By default it is set to 20 iterations.
```

While not strictly required, we also strongly suggest you change the MONGO username and password fields as well.
Expand Down
2 changes: 1 addition & 1 deletion dataherald/sql_generator/dataherald_finetuning_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def create_sql_agent(
suffix: str = FINETUNING_AGENT_SUFFIX,
format_instructions: str = FORMAT_INSTRUCTIONS,
input_variables: List[str] | None = None,
max_iterations: int | None = 12,
max_iterations: int | None = int(os.getenv("AGENT_MAX_ITERATIONS", "20")),
max_execution_time: float | None = None,
early_stopping_method: str = "force",
verbose: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion dataherald/sql_generator/dataherald_sqlagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def create_sql_agent(
input_variables: List[str] | None = None,
max_examples: int = 20,
number_of_instructions: int = 1,
max_iterations: int | None = 15,
max_iterations: int | None = int(os.getenv("AGENT_MAX_ITERATIONS", "20")),
max_execution_time: float | None = None,
early_stopping_method: str = "force",
verbose: bool = False,
Expand Down

0 comments on commit 8955b29

Please sign in to comment.