-
Notifications
You must be signed in to change notification settings - Fork 29
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
Is there a way to print both tool use requests and responses inside chat.toolloop? #9
Comments
I want that too! At some point I'll get around to adding it... |
In case anyone is in the same situation... import functools
def debug_print(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
result = func(*args, **kwargs)
print(f"TOOL DEBUG: {func.__name__}() returned {result}")
return result
return wrapper You can use it by prefixing your tool functions with @debug_print
def get_customer_info(...):
... If I have time this week I'll try to add the functionality to claudette (although I wouldn't do it with a decorator) |
Printing the chat history (
|
@comhar let me check and report back |
Not really. I'm using |
Ah ok. If we change raw trace_functl_trace_raw.movHere's a cleaner version which better highlights the tool call. clean trace_functl_trace_clean.mov@maraoz would this solve your problem? |
@comhar yes! love it :) |
Hi, sorry if this is a dumb question but I've been trying to make this work and reading the source code and I've had no luck.
I'm playing with an assistant which has 3 tools.
I'm trying to print everything that's happening so I can debug the system prompt and the initial message prompt.
However, if I call
chat.toolloop
like so:I only get prints of:
tool_use
requestI'm not seeing, however, any output regarding the tool function call, nor the results and how they are sent to Claude (which would be very useful in debugging).
To work around this, I added prints inside the tool function, but the result is a little weird (at least to me):
The prints from the tool function call appear before (1) from above.
The question is: is there easy way to have the debug prints in chronological order (that is, (1), (2), tool function prints, (3))?
Thanks in advance! Claudette inspired me to play with Claude API and it's fun! :)
The text was updated successfully, but these errors were encountered: