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

Fix/flaky tools #138

Merged
merged 5 commits into from
Dec 12, 2023
Merged

Fix/flaky tools #138

merged 5 commits into from
Dec 12, 2023

Conversation

0xArdi
Copy link
Collaborator

@0xArdi 0xArdi commented Nov 28, 2023

This PR fixes some flaky behaviour in the deepmind-optimization and prediction_request_claude tools.

Comment on lines 193 to 203
generated_template = template + instructions_format
try:
prompt = PromptTemplate(
input_variables=["user_prompt", "additional_information"],
template=generated_template,
)
except Exception as e:
# it may happen that the generated prompt is not valid
# in that case, we just skip it
print(f"Failed to parse template {generated_template}: {e}")
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we change something before retrying? because it looks like the value of generated_template stays same

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see your point, i guess it makes sense that in such instances we regenerate the template.

@0xArdi 0xArdi merged commit ee7d52e into main Dec 12, 2023
6 checks passed
@0xArdi 0xArdi deleted the fix/flaky-tools branch December 12, 2023 13:34
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.

3 participants