Skip to content

Commit

Permalink
fix: Merge schemas for AI Agent response and request parameter (box/b…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Jul 22, 2024
1 parent 1906468 commit f357bb4
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "c2b0bec", "specHash": "6573c3a", "version": "1.1.0" }
{ "engineHash": "c2b0bec", "specHash": "d36b9f0", "version": "1.1.0" }
14 changes: 4 additions & 10 deletions box_sdk_gen/managers/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

from box_sdk_gen.internal.utils import DateTime

from box_sdk_gen.schemas.ai_agent_ask import AiAgentAsk

from box_sdk_gen.schemas.ai_agent_text_gen import AiAgentTextGen

from box_sdk_gen.schemas.ai_response import AiResponse

from box_sdk_gen.schemas.client_error import ClientError
Expand All @@ -30,9 +26,9 @@

from box_sdk_gen.schemas.ai_text_gen import AiTextGen

from box_sdk_gen.schemas.ai_agent_ask_response import AiAgentAskResponse
from box_sdk_gen.schemas.ai_agent_ask import AiAgentAsk

from box_sdk_gen.schemas.ai_agent_text_gen_response import AiAgentTextGenResponse
from box_sdk_gen.schemas.ai_agent_text_gen import AiAgentTextGen

from box_sdk_gen.networking.auth import Authentication

Expand Down Expand Up @@ -259,7 +255,7 @@ def get_ai_agent_default(
language: Optional[str] = None,
model: Optional[str] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> Union[AiAgentAskResponse, AiAgentTextGenResponse]:
) -> Union[AiAgentAsk, AiAgentTextGen]:
"""
Get the AI agent default config
:param mode: The mode to filter the agent config to return.
Expand Down Expand Up @@ -293,6 +289,4 @@ def get_ai_agent_default(
network_session=self.network_session,
),
)
return deserialize(
response.data, Union[AiAgentAskResponse, AiAgentTextGenResponse]
)
return deserialize(response.data, Union[AiAgentAsk, AiAgentTextGen])
4 changes: 0 additions & 4 deletions box_sdk_gen/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,12 @@

from box_sdk_gen.schemas.ai_agent_basic_gen_tool import *

from box_sdk_gen.schemas.ai_agent_text_gen_response import *

from box_sdk_gen.schemas.ai_agent_text_gen import *

from box_sdk_gen.schemas.ai_text_gen import *

from box_sdk_gen.schemas.ai_agent_basic_text_tool_ask import *

from box_sdk_gen.schemas.ai_agent_ask_response import *

from box_sdk_gen.schemas.ai_agent_ask import *

from box_sdk_gen.schemas.ai_ask import *
Expand Down
7 changes: 3 additions & 4 deletions box_sdk_gen/schemas/ai_agent_ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ class AiAgentAsk(BaseObject):
def __init__(
self,
*,
type: AiAgentAskTypeField = AiAgentAskTypeField.AI_AGENT_ASK.value,
type: Optional[AiAgentAskTypeField] = None,
long_text: Optional[AiAgentLongTextTool] = None,
basic_text: Optional[AiAgentBasicTextToolAsk] = None,
long_text_multi: Optional[AiAgentLongTextTool] = None,
basic_text_multi: Optional[AiAgentBasicTextToolAsk] = None,
**kwargs
):
"""
:param type: The type of AI agent used to handle queries.
This parameter is **required**., defaults to AiAgentAskTypeField.AI_AGENT_ASK.value
:type type: AiAgentAskTypeField, optional
:param type: The type of AI agent used to handle queries., defaults to None
:type type: Optional[AiAgentAskTypeField], optional
"""
super().__init__(**kwargs)
self.type = type
Expand Down
38 changes: 0 additions & 38 deletions box_sdk_gen/schemas/ai_agent_ask_response.py

This file was deleted.

7 changes: 3 additions & 4 deletions box_sdk_gen/schemas/ai_agent_text_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ class AiAgentTextGen(BaseObject):
def __init__(
self,
*,
type: AiAgentTextGenTypeField = AiAgentTextGenTypeField.AI_AGENT_TEXT_GEN.value,
type: Optional[AiAgentTextGenTypeField] = None,
basic_gen: Optional[AiAgentBasicGenTool] = None,
**kwargs
):
"""
:param type: The type of AI agent used for generating text.
This parameter is **required**., defaults to AiAgentTextGenTypeField.AI_AGENT_TEXT_GEN.value
:type type: AiAgentTextGenTypeField, optional
:param type: The type of AI agent used for generating text., defaults to None
:type type: Optional[AiAgentTextGenTypeField], optional
"""
super().__init__(**kwargs)
self.type = type
Expand Down
30 changes: 0 additions & 30 deletions box_sdk_gen/schemas/ai_agent_text_gen_response.py

This file was deleted.

2 changes: 1 addition & 1 deletion box_sdk_gen/schemas/app_item_event_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
:type id: str
:param app_item_type: The type of the `AppItem`
:type app_item_type: str
:param type: The type of the source that this event represents. Can be only `app_item`.
:param type: The type of the source that this event represents. Can only be `app_item`.
, defaults to AppItemEventSourceTypeField.APP_ITEM.value
:type type: AppItemEventSourceTypeField, optional
"""
Expand Down
2 changes: 1 addition & 1 deletion docs/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ _Currently we don't have an example for calling `get_ai_agent_default` in integr

### Returns

This function returns a value of type `Union[AiAgentAskResponse, AiAgentTextGenResponse]`.
This function returns a value of type `Union[AiAgentAsk, AiAgentTextGen]`.

A successful response including the default agent configuration.
This response can be one of the following two objects:
Expand Down

0 comments on commit f357bb4

Please sign in to comment.