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

Teleprompt Base Class -> ABC, Some Static Typing, and Ruff Fixes/Updates #467

Closed
wants to merge 0 commits into from

Conversation

mgbvox
Copy link
Contributor

@mgbvox mgbvox commented Feb 26, 2024

Only clear dsp.setting.trace in assertions.py if a trace object exists.

Adapt YouRM API call signature to match the documentation on https://api.you.com/api-key; update return data to respect self.k (as opposed to returning all snippets from the first K hits).

@insop
Copy link
Contributor

insop commented Feb 26, 2024

It's be great if you add a you.com entry to this document? that will help others who want to use you.com
If you prefer, a separate PR would work for sure.

@mgbvox
Copy link
Contributor Author

mgbvox commented Feb 26, 2024

@insop do you mean to the documentation? Sure, I can add that. Will get to it this evening.

@@ -237,7 +237,9 @@ def wrapper(*args, **kwargs):
break
else:
try:
dsp.settings.trace.clear()
# only try to clear the trace if one exists
Copy link
Collaborator

Choose a reason for hiding this comment

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

Overall this makes sense but I worry it's hiding a different issue under the hood?

cc @arnavsinghvi11 @manishshettym @Shangyint

@mgbvox
Copy link
Contributor Author

mgbvox commented Feb 28, 2024

Had less bandwidth than I anticipated, I plan to sit down and contribute a bunch come early March.

@okhat
Copy link
Collaborator

okhat commented Mar 2, 2024

Tagging @arnavsinghvi11 for the issue above it comes up a lot: dsp.settings.trace being None by default causes issues. Is setting it globally to [] correct? Probably not? It affects optimization somewhere? Is there any code checking for dspy.settings.trace that assumes it None and [] are different?

@arnavsinghvi11
Copy link
Collaborator

dsp.settings.trace

Yeah I believe we should set it to [] going forward since there are checks in assertion.py. It seems that the optimizations logic also set trace = [] internally so I believe we can make this change globally in settings. Let me know if that aligns and I can push a PR for it.

@Shangyint
Copy link
Collaborator

dsp.settings.trace

Yeah I believe we should set it to [] going forward since there are checks in assertion.py. It seems that the optimizations logic also set trace = [] internally so I believe we can make this change globally in settings. Let me know if that aligns and I can push a PR for it.

Agree with @arnavsinghvi11, setting trace to [] by default looks good.

@mgbvox mgbvox changed the title YouRM Updates: Respect self.k Teleprompt Base Class -> ABC, Some Static Typing, and Ruff Fixes/Updates Mar 7, 2024
@arnavsinghvi11 arnavsinghvi11 mentioned this pull request Mar 9, 2024
@mgbvox mgbvox closed this Mar 18, 2024
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.

5 participants