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

Allow users to add metadata on end() #1085

Merged
merged 14 commits into from
Oct 11, 2024
Merged

Allow users to add metadata on end() #1085

merged 14 commits into from
Oct 11, 2024

Conversation

nhuang-lc
Copy link
Contributor

No description provided.

@nhuang-lc nhuang-lc requested a review from agola11 October 10, 2024 19:16
Copy link
Contributor

@agola11 agola11 left a 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

@nhuang-lc nhuang-lc requested a review from agola11 October 11, 2024 02:16
"Test end() write to metadata",
async () => {
const runMeta = uuid.v4();
const projectName = `__test_end_metadata_run_tree_js ${runMeta}`;
Copy link
Contributor

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_))
Copy link
Contributor

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

@nhuang-lc nhuang-lc merged commit 540c1a5 into main Oct 11, 2024
15 of 16 checks passed
@nhuang-lc nhuang-lc deleted the nh/add-metadata-on-end branch October 11, 2024 19:11
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.

2 participants