-
Notifications
You must be signed in to change notification settings - Fork 678
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(haystack): add input and output #1202
Conversation
@tibor-reiss want to rebase and fix the lint issues? we can merge this one as well (although it won't solve #1169 completely - it's a much needed work in this direction) |
3842155
to
7837e22
Compare
@nirga Rebased, fixed linting issue. |
kwargs_to_serialize[key] = value | ||
args_to_serialize = [arg for arg in args if not isinstance(arg, dict)] | ||
input_entity = {"args": args_to_serialize, "kwargs": kwargs_to_serialize} | ||
return json.dumps(input_entity, cls=EnhancedJSONEncoder) |
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.
@tibor-reiss almost missed this - should be behind if should_send_prompts()
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.
Good catch, thanks!
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.
@nirga Just looked at it a second time: should this check rather be in wrap_pipeline.py? Otherwise both spans will be set to None even if should_send_prompts would be False.
I was using the implementation in langchain as blueprint, however I did not like that much that the process_request / process_response functions change state (it's kinda a side effect, and also harder to test).
Let me know your preference!
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'd keep it separate since we may be adding more things to process_request / process_response
920e41e
to
b5f7825
Compare
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.
Thank you @tibor-reiss!
Towards #1169
feat(instrumentation): ...
orfix(instrumentation): ...
.