Skip to content

Commit

Permalink
fix: Add missing fields to Sign Template Signer and fix AI schema (bo…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build authored Aug 22, 2024
1 parent 0337e06 commit 0708351
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "0b023a8", "specHash": "da821cd", "version": "1.2.0" }
{ "engineHash": "6dfffba", "specHash": "57614c2", "version": "1.3.0" }
14 changes: 7 additions & 7 deletions box_sdk_gen/managers/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ class CreateAiTextGenItems(BaseObject):

def __init__(
self,
id: str,
*,
id: Optional[str] = None,
type: Optional[CreateAiTextGenItemsTypeField] = None,
type: CreateAiTextGenItemsTypeField = CreateAiTextGenItemsTypeField.FILE.value,
content: Optional[str] = None,
**kwargs
):
"""
: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[CreateAiTextGenItemsTypeField], optional
:param id: The ID of the item.
:type id: str
:param type: The type of the item., defaults to CreateAiTextGenItemsTypeField.FILE.value
:type type: CreateAiTextGenItemsTypeField, optional
:param content: The content to use as context for generating new text or editing existing text., defaults to None
:type content: Optional[str], optional
"""
Expand Down Expand Up @@ -207,7 +207,7 @@ def create_ai_text_gen(
**Note**: Box AI handles documents with text representations up to 1MB in size.
If the file size exceeds 1MB, the first 1MB of text representation will be processed.
:type items: List[CreateAiTextGenItems]
:param dialogue_history: The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response., defaults to None
:param dialogue_history: The history of prompts and answers previously passed to the LLM. This parameter provides the additional context to the LLM when generating the response., defaults to None
:type dialogue_history: Optional[List[AiDialogueHistory]], optional
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
Expand Down
4 changes: 2 additions & 2 deletions box_sdk_gen/managers/integration_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def get_slack_integration_mapping(

def create_slack_integration_mapping(
self,
box_item: IntegrationMappingBoxItemSlack,
partner_item: IntegrationMappingPartnerItemSlack,
box_item: IntegrationMappingBoxItemSlack,
*,
options: Optional[IntegrationMappingSlackOptions] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
Expand All @@ -170,9 +170,9 @@ def create_slack_integration_mapping(
if extra_headers is None:
extra_headers = {}
request_body: Dict = {
'partner_item': partner_item,
'box_item': box_item,
'options': options,
'partner_item': partner_item,
}
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = fetch(
Expand Down
8 changes: 6 additions & 2 deletions box_sdk_gen/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,19 @@

from box_sdk_gen.schemas.ai_llm_endpoint_params_open_ai import *

from box_sdk_gen.schemas.ai_agent_basic_text_tool_base import *

from box_sdk_gen.schemas.ai_agent_basic_text_tool_text_gen import *

from box_sdk_gen.schemas.ai_agent_long_text_tool import *
from box_sdk_gen.schemas.ai_agent_long_text_tool_text_gen import *

from box_sdk_gen.schemas.ai_agent_basic_gen_tool import *

from box_sdk_gen.schemas.ai_agent_text_gen import *

from box_sdk_gen.schemas.ai_agent_basic_text_tool_ask import *
from box_sdk_gen.schemas.ai_agent_basic_text_tool import *

from box_sdk_gen.schemas.ai_agent_long_text_tool import *

from box_sdk_gen.schemas.ai_agent_ask import *

Expand Down
6 changes: 3 additions & 3 deletions box_sdk_gen/schemas/ai_agent_ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from box_sdk_gen.schemas.ai_agent_long_text_tool import AiAgentLongTextTool

from box_sdk_gen.schemas.ai_agent_basic_text_tool_ask import AiAgentBasicTextToolAsk
from box_sdk_gen.schemas.ai_agent_basic_text_tool import AiAgentBasicTextTool


class AiAgentAskTypeField(str, Enum):
Expand All @@ -21,9 +21,9 @@ def __init__(
*,
type: AiAgentAskTypeField = AiAgentAskTypeField.AI_AGENT_ASK.value,
long_text: Optional[AiAgentLongTextTool] = None,
basic_text: Optional[AiAgentBasicTextToolAsk] = None,
basic_text: Optional[AiAgentBasicTextTool] = None,
long_text_multi: Optional[AiAgentLongTextTool] = None,
basic_text_multi: Optional[AiAgentBasicTextToolAsk] = None,
basic_text_multi: Optional[AiAgentBasicTextTool] = None,
**kwargs
):
"""
Expand Down
30 changes: 18 additions & 12 deletions box_sdk_gen/schemas/ai_agent_basic_gen_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,30 @@

from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle

from box_sdk_gen.schemas.ai_agent_basic_text_tool_base import AiAgentBasicTextToolBase

from box_sdk_gen.schemas.ai_agent_basic_text_tool_text_gen import (
AiAgentBasicTextToolTextGen,
)

from box_sdk_gen.schemas.ai_agent_long_text_tool import (
AiAgentLongTextToolEmbeddingsField,
from box_sdk_gen.schemas.ai_agent_long_text_tool_text_gen import (
AiAgentLongTextToolTextGenEmbeddingsField,
)

from box_sdk_gen.schemas.ai_agent_long_text_tool import AiAgentLongTextTool
from box_sdk_gen.schemas.ai_agent_long_text_tool_text_gen import (
AiAgentLongTextToolTextGen,
)


class AiAgentBasicGenTool(AiAgentLongTextTool):
class AiAgentBasicGenTool(AiAgentLongTextToolTextGen):
def __init__(
self,
*,
content_template: Optional[str] = None,
embeddings: Optional[AiAgentLongTextToolEmbeddingsField] = None,
model: Optional[str] = None,
embeddings: Optional[AiAgentLongTextToolTextGenEmbeddingsField] = None,
system_message: Optional[str] = None,
prompt_template: Optional[str] = None,
model: Optional[str] = None,
num_tokens_for_completion: Optional[int] = None,
llm_endpoint_params: Optional[
Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]
Expand All @@ -34,26 +38,28 @@ def __init__(
):
"""
:param content_template: How the content should be included in a request to the LLM.
When passing this parameter, you must include `{content}`., defaults to None
Input for `{content}` is optional, depending on the use., defaults to None
:type content_template: Optional[str], optional
:param model: The model to be used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param system_message: System messages try to help the LLM "understand" its role and what it is supposed to do.
This parameter requires using `{current_date}`., defaults to None
Input for `{current_date}` is optional, depending on the use., defaults to None
:type system_message: Optional[str], optional
:param prompt_template: The prompt template contains contextual information of the request and the user prompt.
When using the `prompt_template` parameter, you **must include** input for `{user_question}`.
Inputs for `{current_date}` and`{content}` are optional, depending on the use., defaults to None
Inputs for `{current_date}` and `{content}` are optional, depending on the use., defaults to None
:type prompt_template: Optional[str], optional
:param model: The model used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param num_tokens_for_completion: The number of tokens for completion., defaults to None
:type num_tokens_for_completion: Optional[int], optional
:param llm_endpoint_params: The parameters for the LLM endpoint specific to OpenAI / Google models., defaults to None
:type llm_endpoint_params: Optional[Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]], optional
"""
super().__init__(
embeddings=embeddings,
model=model,
system_message=system_message,
prompt_template=prompt_template,
model=model,
num_tokens_for_completion=num_tokens_for_completion,
llm_endpoint_params=llm_endpoint_params,
**kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,47 @@

from typing import Union

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.schemas.ai_llm_endpoint_params_open_ai import AiLlmEndpointParamsOpenAi

from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle

from box_sdk_gen.schemas.ai_agent_basic_text_tool_base import AiAgentBasicTextToolBase


class AiAgentBasicTextToolAsk(BaseObject):
class AiAgentBasicTextTool(AiAgentBasicTextToolBase):
def __init__(
self,
*,
model: Optional[str] = None,
system_message: Optional[str] = None,
prompt_template: Optional[str] = None,
model: Optional[str] = None,
num_tokens_for_completion: Optional[int] = None,
llm_endpoint_params: Optional[
Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]
] = None,
**kwargs
):
"""
:param model: The model used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param system_message: System messages try to help the LLM "understand" its role and what it is supposed to do., defaults to None
:type system_message: Optional[str], optional
:param prompt_template: The prompt template contains contextual information of the request and the user prompt.
When passing `prompt_template` parameters, you **must include** inputs for `{current_date}`, `{user_question}`, and `{content}`., defaults to None
When passing `prompt_template` parameters, you **must include** inputs for `{user_question}` and `{content}`.
Input for `{current_date}` is optional, depending on the use., defaults to None
:type prompt_template: Optional[str], optional
:param model: The model used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param num_tokens_for_completion: The number of tokens for completion., defaults to None
:type num_tokens_for_completion: Optional[int], optional
:param llm_endpoint_params: The parameters for the LLM endpoint specific to OpenAI / Google models., defaults to None
:type llm_endpoint_params: Optional[Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]], optional
"""
super().__init__(**kwargs)
self.model = model
super().__init__(
model=model,
num_tokens_for_completion=num_tokens_for_completion,
llm_endpoint_params=llm_endpoint_params,
**kwargs
)
self.system_message = system_message
self.prompt_template = prompt_template
self.num_tokens_for_completion = num_tokens_for_completion
self.llm_endpoint_params = llm_endpoint_params
34 changes: 34 additions & 0 deletions box_sdk_gen/schemas/ai_agent_basic_text_tool_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from typing import Optional

from typing import Union

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.schemas.ai_llm_endpoint_params_open_ai import AiLlmEndpointParamsOpenAi

from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle


class AiAgentBasicTextToolBase(BaseObject):
def __init__(
self,
*,
model: Optional[str] = None,
num_tokens_for_completion: Optional[int] = None,
llm_endpoint_params: Optional[
Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]
] = None,
**kwargs
):
"""
:param model: The model used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param num_tokens_for_completion: The number of tokens for completion., defaults to None
:type num_tokens_for_completion: Optional[int], optional
:param llm_endpoint_params: The parameters for the LLM endpoint specific to OpenAI / Google models., defaults to None
:type llm_endpoint_params: Optional[Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]], optional
"""
super().__init__(**kwargs)
self.model = model
self.num_tokens_for_completion = num_tokens_for_completion
self.llm_endpoint_params = llm_endpoint_params
28 changes: 16 additions & 12 deletions box_sdk_gen/schemas/ai_agent_basic_text_tool_text_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,47 @@

from typing import Union

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.schemas.ai_llm_endpoint_params_open_ai import AiLlmEndpointParamsOpenAi

from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle

from box_sdk_gen.schemas.ai_agent_basic_text_tool_base import AiAgentBasicTextToolBase


class AiAgentBasicTextToolTextGen(BaseObject):
class AiAgentBasicTextToolTextGen(AiAgentBasicTextToolBase):
def __init__(
self,
*,
model: Optional[str] = None,
system_message: Optional[str] = None,
prompt_template: Optional[str] = None,
model: Optional[str] = None,
num_tokens_for_completion: Optional[int] = None,
llm_endpoint_params: Optional[
Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]
] = None,
**kwargs
):
"""
:param model: The model to be used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param system_message: System messages try to help the LLM "understand" its role and what it is supposed to do.
This parameter requires using `{current_date}`., defaults to None
Input for `{current_date}` is optional, depending on the use., defaults to None
:type system_message: Optional[str], optional
:param prompt_template: The prompt template contains contextual information of the request and the user prompt.
When using the `prompt_template` parameter, you **must include** input for `{user_question}`.
Inputs for `{current_date}` and`{content}` are optional, depending on the use., defaults to None
Inputs for `{current_date}` and `{content}` are optional, depending on the use., defaults to None
:type prompt_template: Optional[str], optional
:param model: The model used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param num_tokens_for_completion: The number of tokens for completion., defaults to None
:type num_tokens_for_completion: Optional[int], optional
:param llm_endpoint_params: The parameters for the LLM endpoint specific to OpenAI / Google models., defaults to None
:type llm_endpoint_params: Optional[Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]], optional
"""
super().__init__(**kwargs)
self.model = model
super().__init__(
model=model,
num_tokens_for_completion=num_tokens_for_completion,
llm_endpoint_params=llm_endpoint_params,
**kwargs
)
self.system_message = system_message
self.prompt_template = prompt_template
self.num_tokens_for_completion = num_tokens_for_completion
self.llm_endpoint_params = llm_endpoint_params
26 changes: 14 additions & 12 deletions box_sdk_gen/schemas/ai_agent_long_text_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle

from box_sdk_gen.schemas.ai_agent_basic_text_tool_text_gen import (
AiAgentBasicTextToolTextGen,
)
from box_sdk_gen.schemas.ai_agent_basic_text_tool_base import AiAgentBasicTextToolBase

from box_sdk_gen.schemas.ai_agent_basic_text_tool import AiAgentBasicTextTool


class AiAgentLongTextToolEmbeddingsStrategyField(BaseObject):
Expand Down Expand Up @@ -49,38 +49,40 @@ def __init__(
self.strategy = strategy


class AiAgentLongTextTool(AiAgentBasicTextToolTextGen):
class AiAgentLongTextTool(AiAgentBasicTextTool):
def __init__(
self,
*,
embeddings: Optional[AiAgentLongTextToolEmbeddingsField] = None,
model: Optional[str] = None,
system_message: Optional[str] = None,
prompt_template: Optional[str] = None,
model: Optional[str] = None,
num_tokens_for_completion: Optional[int] = None,
llm_endpoint_params: Optional[
Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]
] = None,
**kwargs
):
"""
:param model: The model to be used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param system_message: System messages try to help the LLM "understand" its role and what it is supposed to do.
This parameter requires using `{current_date}`., defaults to None
:param system_message: System messages try to help the LLM "understand" its role and what it is supposed to do., defaults to None
:type system_message: Optional[str], optional
:param prompt_template: The prompt template contains contextual information of the request and the user prompt.
When using the `prompt_template` parameter, you **must include** input for `{user_question}`.
Inputs for `{current_date}` and`{content}` are optional, depending on the use., defaults to None
When passing `prompt_template` parameters, you **must include** inputs for `{user_question}` and `{content}`.
Input for `{current_date}` is optional, depending on the use., defaults to None
:type prompt_template: Optional[str], optional
:param model: The model used for the AI Agent for basic text., defaults to None
:type model: Optional[str], optional
:param num_tokens_for_completion: The number of tokens for completion., defaults to None
:type num_tokens_for_completion: Optional[int], optional
:param llm_endpoint_params: The parameters for the LLM endpoint specific to OpenAI / Google models., defaults to None
:type llm_endpoint_params: Optional[Union[AiLlmEndpointParamsOpenAi, AiLlmEndpointParamsGoogle]], optional
"""
super().__init__(
model=model,
system_message=system_message,
prompt_template=prompt_template,
model=model,
num_tokens_for_completion=num_tokens_for_completion,
llm_endpoint_params=llm_endpoint_params,
**kwargs
Expand Down
Loading

0 comments on commit 0708351

Please sign in to comment.