-
Notifications
You must be signed in to change notification settings - Fork 89
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
Allow users to add metadata on end() #1085
Conversation
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 would add an integration test in https://github.com/langchain-ai/langsmith-sdk/blob/main/python/tests/integration_tests/test_runs.py (it actually seems like we don't have any for RunTree explicitly there :/ )
Basically, just create a run tree and log in a test, try to fetch the run and check to see that it has the metadata.
Should also implement in JS
…smith-sdk into nh/add-metadata-on-end
js/src/tests/run_trees.int.test.ts
Outdated
"Test end() write to metadata", | ||
async () => { | ||
const runMeta = uuid.v4(); | ||
const projectName = `__test_end_metadata_run_tree_js ${runMeta}`; |
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.
If you're creating a project with UUID in the name, you should clean it up after the test. Also should consolidate how you're doing in py and JS. I would honestly just create a unique project and clean up at end of test in py and js
) | ||
poll_runs_until_count(langchain_client, project_name, 1, filter_=filter_) | ||
|
||
runs_ = list(langchain_client.list_runs(project_name=project_name, filter=filter_)) |
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 would explicitly set the run_id in RunTree
, then fetch the run by run id. That guarantees you're looking at the exact same run you just posted. If someone else were to write to this project, it might throw off your test
No description provided.