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

python: add Client.similar_examples() and Client.index_dataset() #924

Merged
merged 20 commits into from
Aug 20, 2024

Conversation

baskaryan
Copy link
Contributor

@baskaryan baskaryan commented Aug 15, 2024

Add methods for interacting with datasets/{dataset_id}/index and datasets/{dataset_id}/search endpoints.

Indexing takes a second so the integration test is skipped by default. Could turn it on or could update to use an existing index instead of creating one as part of the test.

python/langsmith/client.py Outdated Show resolved Hide resolved
@baskaryan baskaryan changed the title [WIP] python: add Client.search_examples() [WIP] python: add Client.similar_examples() Aug 16, 2024
@baskaryan baskaryan changed the title [WIP] python: add Client.similar_examples() python: add Client.similar_examples() and Client.index_dataset() Aug 18, 2024
@baskaryan baskaryan requested a review from hinthornw August 18, 2024 19:58
)
langchain_client.index_dataset(dataset_id=dataset.id)
# Need to wait for indexing to finish.
time.sleep(5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to figure out a way to not make people need to do this...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea ideally you could poll it till its done. but also this is a one-time thing for any dataset so wonder if it's that high prio.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an indicator in the output to read_dataset we could use?

@baskaryan baskaryan merged commit bee2a0c into main Aug 20, 2024
7 of 8 checks passed
@baskaryan baskaryan deleted the bagatur/search_examples branch August 20, 2024 07:18
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.

3 participants