-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add parameters to box ai ask and text gen (box/box-openapi#445)
- Loading branch information
1 parent
bc25040
commit 7cb0b8d
Showing
12 changed files
with
163 additions
and
75 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 +1 @@ | ||
{ "engineHash": "d1cb68d", "specHash": "9919482", "version": "1.2.0" } | ||
{ "engineHash": "d1cb68d", "specHash": "871a814", "version": "1.2.0" } |
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from typing import Optional | ||
|
||
from typing import List | ||
|
||
from box_sdk_gen.internal.base_object import BaseObject | ||
|
||
from box_sdk_gen.schemas.ai_citation import AiCitation | ||
|
||
from box_sdk_gen.internal.utils import DateTime | ||
|
||
|
||
class AiAskResponse(BaseObject): | ||
def __init__( | ||
self, | ||
answer: str, | ||
created_at: DateTime, | ||
*, | ||
completion_reason: Optional[str] = None, | ||
citations: Optional[List[AiCitation]] = None, | ||
**kwargs | ||
): | ||
""" | ||
:param answer: The answer provided by the LLM. | ||
:type answer: str | ||
:param created_at: The ISO date formatted timestamp of when the answer to the prompt was created. | ||
:type created_at: DateTime | ||
:param completion_reason: The reason the response finishes., defaults to None | ||
:type completion_reason: Optional[str], optional | ||
:param citations: The citations of the LLM's answer reference., defaults to None | ||
:type citations: Optional[List[AiCitation]], optional | ||
""" | ||
super().__init__(**kwargs) | ||
self.answer = answer | ||
self.created_at = created_at | ||
self.completion_reason = completion_reason | ||
self.citations = citations |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from enum import Enum | ||
|
||
from typing import Optional | ||
|
||
from box_sdk_gen.internal.base_object import BaseObject | ||
|
||
|
||
class AiCitationTypeField(str, Enum): | ||
FILE = 'file' | ||
|
||
|
||
class AiCitation(BaseObject): | ||
_discriminator = 'type', {'file'} | ||
|
||
def __init__( | ||
self, | ||
*, | ||
content: Optional[str] = None, | ||
id: Optional[str] = None, | ||
type: Optional[AiCitationTypeField] = None, | ||
name: Optional[str] = None, | ||
**kwargs | ||
): | ||
""" | ||
:param content: The specific content from where the answer was referenced., defaults to None | ||
:type content: Optional[str], optional | ||
:param id: The id of the item., defaults to None | ||
:type id: Optional[str], optional | ||
:param type: The type of the item., defaults to None | ||
:type type: Optional[AiCitationTypeField], optional | ||
:param name: The name of the item., defaults to None | ||
:type name: Optional[str], optional | ||
""" | ||
super().__init__(**kwargs) | ||
self.content = content | ||
self.id = id | ||
self.type = type | ||
self.name = name |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Optional | ||
|
||
from box_sdk_gen.internal.base_object import BaseObject | ||
|
||
from box_sdk_gen.internal.utils import DateTime | ||
|
||
|
||
class AiDialogueHistory(BaseObject): | ||
def __init__( | ||
self, | ||
*, | ||
prompt: Optional[str] = None, | ||
answer: Optional[str] = None, | ||
created_at: Optional[DateTime] = None, | ||
**kwargs | ||
): | ||
""" | ||
:param prompt: The prompt previously provided by the client and answered by the LLM., defaults to None | ||
:type prompt: Optional[str], optional | ||
:param answer: The answer previously provided by the LLM., defaults to None | ||
:type answer: Optional[str], optional | ||
:param created_at: The ISO date formatted timestamp of when the previous answer to the prompt was created., defaults to None | ||
:type created_at: Optional[DateTime], optional | ||
""" | ||
super().__init__(**kwargs) | ||
self.prompt = prompt | ||
self.answer = answer | ||
self.created_at = created_at |
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
Oops, something went wrong.