Skip to content
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

Retry tavily outside of model parsing and allow to not generate subqueries #104

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

kongzii
Copy link
Collaborator

@kongzii kongzii commented Aug 1, 2024

No description provided.

@kongzii kongzii marked this pull request as ready for review August 1, 2024 08:29
@kongzii kongzii changed the title Retry tavily outside of model parsing Retry tavily outside of model parsing and allow to not generate subqueries Aug 1, 2024
Copy link
Collaborator

@evangriffiths evangriffiths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just in case there is a bug inside the transformed_results = [...] bit of the function?

@@ -29,7 +29,7 @@ def research(
logger: t.Union[logging.Logger, "Logger"] = logging.getLogger()
) -> str:
logger.info("Started subqueries generation")
queries = generate_subqueries(query=goal, limit=initial_subqueries_limit, model=model, api_key=openai_api_key)
queries = generate_subqueries(query=goal, limit=initial_subqueries_limit, model=model, api_key=openai_api_key) if initial_subqueries_limit > 0 else [goal]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo makes more sense to move this into the function definition - i.e. at the start:

if limit == 0:
  return [query]

so don't need to have this logic wherever it's used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no preference on my side

@kongzii
Copy link
Collaborator Author

kongzii commented Aug 1, 2024

Is this just in case there is a bug inside the transformed_results = [...] bit of the function?

yeah, if they change output model, it won't help to retry the call

@kongzii kongzii merged commit 0564033 into main Aug 1, 2024
1 check passed
@kongzii kongzii deleted the peter/retryoutside branch August 1, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants