-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional Beta flag for QA requests (#74)
Allows for testing out new beta implementations, if they are available. Setting this to true will only change the behavior if there is a currently running beta available. Disclaimer: Pricing, performance, and behavior are subject to change at any time for beta implementations. Please be aware of this before using. You can always reach out to [email protected] if you have questions.
- Loading branch information
Showing
4 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Changelog | ||
|
||
## 2.7.1 | ||
|
||
- Add beta flag for QA requests | ||
|
||
## 2.7.0 | ||
|
||
- Add manual on readthedocs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1215,6 +1215,7 @@ def qa( | |
request: QaRequest, | ||
model: Optional[str] = None, | ||
checkpoint: Optional[str] = None, | ||
beta: bool = False, | ||
) -> QaResponse: | ||
"""Answers a question about documents. | ||
|
@@ -1233,6 +1234,13 @@ def qa( | |
Need to set exactly one of model_name and checkpoint_name. | ||
beta (bool, optional, default False): | ||
Opt-in use of new beta implementations of the QA endpoint, if available. Setting this to true will only change the | ||
behavior if there is a currently running beta available. | ||
Disclaimer: Pricing, performance, and behavior are subject to change at any time for beta implementations. Please be | ||
aware of this before using. You can always reach out to [email protected] if you have questions. | ||
Examples: | ||
>>> request = QaRequest( | ||
query="Who likes pizza?", | ||
|
@@ -1241,7 +1249,7 @@ def qa( | |
>>> response = client.qa(request, model="luminous-extended") | ||
""" | ||
response = self._post_request( | ||
"qa", | ||
"qa/beta" if beta else "qa", | ||
request, | ||
model, | ||
checkpoint, | ||
|
@@ -1709,6 +1717,7 @@ async def qa( | |
request: QaRequest, | ||
model: Optional[str] = None, | ||
checkpoint: Optional[str] = None, | ||
beta: bool = True, | ||
) -> QaResponse: | ||
"""Answers a question about documents. | ||
|
@@ -1727,6 +1736,13 @@ async def qa( | |
Need to set exactly one of model_name and checkpoint_name. | ||
beta (bool, optional, default False): | ||
Opt-in use of new beta implementations of the QA endpoint, if available. Setting this to true will only change the | ||
behavior if there is a currently running beta available. | ||
Disclaimer: Pricing, performance, and behavior are subject to change at any time for beta implementations. Please be | ||
aware of this before using. You can always reach out to [email protected] if you have questions. | ||
Examples: | ||
>>> request = QaRequest( | ||
query="Who likes pizza?", | ||
|
@@ -1735,7 +1751,7 @@ async def qa( | |
>>> response = await client.qa(request, model="luminous-extended") | ||
""" | ||
response = await self._post_request( | ||
"qa", | ||
"qa/beta" if beta else "qa", | ||
request, | ||
model, | ||
checkpoint, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "2.7.0" | ||
__version__ = "2.7.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters