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

Add additional examples for other modules to partners/exa README #18081

Merged
merged 5 commits into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 42 additions & 0 deletions libs/partners/exa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,46 @@ results = exa.get_relevant_documents(query="What is the capital of France?")

# Print the results
print(results)
```

## Exa Search Results

You can run the ExaSearchResults module as follows

```python
from langchain_exa import ExaSearchResults

# Initialize the ExaSearchResults tool
search_tool = ExaSearchResults(exa_api_key="YOUR API KEY")

# Perform a search query
search_results = search_tool._run(
query="When was the last time the New York Knicks won the NBA Championship?",
num_results=5,
text_contents_options=True,
highlights=True
)

print("Search Results:", search_results)
```

## Exa Find Similar Results

You can run the ExaFindSimilarResults module as follows

```python
from langchain_exa import ExaFindSimilarResults

# Initialize the ExaFindSimilarResults tool
find_similar_tool = ExaFindSimilarResults(exa_api_key="YOUR API KEY")

# Find similar results based on a URL
similar_results = find_similar_tool._run(
url="http://espn.com",
num_results=5,
text_contents_options=True,
highlights=True
)

print("Similar Results:", similar_results)
```