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

docs: Update opensearch retriever docstrings #1035

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,16 @@ def __init__(
An example `run()` method for this `custom_query`:

```python
retriever.run(query="Why did the revenue increase?",
filters={"years": ["2019"], "quarters": ["Q1", "Q2"]})
retriever.run(
query="Why did the revenue increase?",
filters={
"operator": "AND",
"conditions": [
{"field": "meta.years", "operator": "==", "value": "2019"},
{"field": "meta.quarters", "operator": "in", "value": ["Q1", "Q2"]},
],
},
)
```
:param raise_on_failure:
Whether to raise an exception if the API call fails. Otherwise log a warning and return an empty list.
Expand Down Expand Up @@ -184,8 +192,16 @@ def run(
**For this custom_query, a sample `run()` could be:**

```python
retriever.run(query="Why did the revenue increase?",
filters={"years": ["2019"], "quarters": ["Q1", "Q2"]})
retriever.run(
query="Why did the revenue increase?",
filters={
"operator": "AND",
"conditions": [
{"field": "meta.years", "operator": "==", "value": "2019"},
{"field": "meta.quarters", "operator": "in", "value": ["Q1", "Q2"]},
],
},
)
```

:returns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,16 @@ def __init__(
For this `custom_query`, an example `run()` could be:

```python
retriever.run(query_embedding=embedding,
filters={"years": ["2019"], "quarters": ["Q1", "Q2"]})
retriever.run(
query_embedding=embedding,
filters={
"operator": "AND",
"conditions": [
{"field": "meta.years", "operator": "==", "value": "2019"},
{"field": "meta.quarters", "operator": "in", "value": ["Q1", "Q2"]},
],
},
)
```
:param raise_on_failure:
If `True`, raises an exception if the API call fails.
Expand Down Expand Up @@ -176,8 +184,16 @@ def run(
For this `custom_query`, an example `run()` could be:

```python
retriever.run(query_embedding=embedding,
filters={"years": ["2019"], "quarters": ["Q1", "Q2"]})
retriever.run(
query_embedding=embedding,
filters={
"operator": "AND",
"conditions": [
{"field": "meta.years", "operator": "==", "value": "2019"},
{"field": "meta.quarters", "operator": "in", "value": ["Q1", "Q2"]},
],
},
)
```

:returns:
Expand Down