-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
add debug dir for prompts #205
Conversation
opendevin/llm/llm.py
Outdated
message_back = resp['choices'][0]['message']['content'] | ||
self.write_debug(messages, message_back) | ||
return resp | ||
self._completion = wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess by wrapping the ._completion
function, we will break the documentation and argument hints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, that's a bummer. What happens if we only wrap it when debug mode is on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that that should make it work? since the wrapping is only happening at the runtime, and the argument hints only depends on static type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 changed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
DEFAULT_MODEL = os.getenv("LLM_MODEL", "gpt-4-0125-preview") | ||
DEFAULT_API_KEY = os.getenv("LLM_API_KEY") | ||
PROMPT_DEBUG_DIR = os.getenv("PROMPT_DEBUG_DIR", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need a centralized documents to keep track of all the Env Vars at some point :)
@rbren opps looks like we need to fix |
👍 found a way to make an exception |
* add debug dir for prompts * add indent to dumps * only wrap completion in debug mode * fix mypy
This PR allows you to set
PROMPT_DEBUG_DIR=./debug
to get a record of every prompt and response. This helps agent creators debug their agents.