h2ogpte 1.6.55rc1__py3-none-any.whl → 1.7.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- h2ogpte/__init__.py +1 -1
- h2ogpte/h2ogpte.py +184 -20
- h2ogpte/h2ogpte_async.py +184 -20
- h2ogpte/rest_async/__init__.py +3 -2
- h2ogpte/rest_async/api/agents_api.py +25 -25
- h2ogpte/rest_async/api/chat_api.py +1077 -21
- h2ogpte/rest_async/api/models_api.py +35 -67
- h2ogpte/rest_async/api_client.py +1 -1
- h2ogpte/rest_async/configuration.py +1 -1
- h2ogpte/rest_async/models/__init__.py +2 -1
- h2ogpte/rest_async/models/chat_completion_request.py +6 -2
- h2ogpte/rest_async/models/chat_settings.py +6 -2
- h2ogpte/rest_async/models/chat_settings_tags.py +140 -0
- h2ogpte/rest_async/models/extractor.py +26 -2
- h2ogpte/rest_async/models/extractor_create_request.py +29 -5
- h2ogpte/rest_async/models/ingest_from_confluence_body.py +4 -2
- h2ogpte/rest_async/models/{create_topic_model_job_request.py → tag_filter.py} +11 -9
- h2ogpte/rest_sync/__init__.py +3 -2
- h2ogpte/rest_sync/api/agents_api.py +25 -25
- h2ogpte/rest_sync/api/chat_api.py +1077 -21
- h2ogpte/rest_sync/api/models_api.py +35 -67
- h2ogpte/rest_sync/api_client.py +1 -1
- h2ogpte/rest_sync/configuration.py +1 -1
- h2ogpte/rest_sync/models/__init__.py +2 -1
- h2ogpte/rest_sync/models/chat_completion_request.py +6 -2
- h2ogpte/rest_sync/models/chat_settings.py +6 -2
- h2ogpte/rest_sync/models/chat_settings_tags.py +140 -0
- h2ogpte/rest_sync/models/extractor.py +26 -2
- h2ogpte/rest_sync/models/extractor_create_request.py +29 -5
- h2ogpte/rest_sync/models/ingest_from_confluence_body.py +4 -2
- h2ogpte/rest_sync/models/{create_topic_model_job_request.py → tag_filter.py} +11 -9
- h2ogpte/session.py +10 -5
- h2ogpte/session_async.py +10 -2
- h2ogpte/types.py +26 -1
- {h2ogpte-1.6.55rc1.dist-info → h2ogpte-1.7.0rc1.dist-info}/METADATA +1 -1
- {h2ogpte-1.6.55rc1.dist-info → h2ogpte-1.7.0rc1.dist-info}/RECORD +39 -37
- {h2ogpte-1.6.55rc1.dist-info → h2ogpte-1.7.0rc1.dist-info}/WHEEL +0 -0
- {h2ogpte-1.6.55rc1.dist-info → h2ogpte-1.7.0rc1.dist-info}/entry_points.txt +0 -0
- {h2ogpte-1.6.55rc1.dist-info → h2ogpte-1.7.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from h2ogpte.rest_async.models.confluence_credentials import ConfluenceCredentials
|
|
23
23
|
from typing import Optional, Set
|
|
@@ -29,9 +29,10 @@ class IngestFromConfluenceBody(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
base_url: StrictStr = Field(description="Base url of the confluence instance.")
|
|
31
31
|
page_ids: List[StrictStr] = Field(description="Ids of pages to be ingested.")
|
|
32
|
+
include_attachments: Optional[StrictBool] = Field(default=False, description="A flag indicating whether to also ingest attachments with the page.")
|
|
32
33
|
credentials: ConfluenceCredentials
|
|
33
34
|
metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata for the documents.")
|
|
34
|
-
__properties: ClassVar[List[str]] = ["base_url", "page_ids", "credentials", "metadata"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["base_url", "page_ids", "include_attachments", "credentials", "metadata"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
populate_by_name=True,
|
|
@@ -89,6 +90,7 @@ class IngestFromConfluenceBody(BaseModel):
|
|
|
89
90
|
_obj = cls.model_validate({
|
|
90
91
|
"base_url": obj.get("base_url"),
|
|
91
92
|
"page_ids": obj.get("page_ids"),
|
|
93
|
+
"include_attachments": obj.get("include_attachments") if obj.get("include_attachments") is not None else False,
|
|
92
94
|
"credentials": ConfluenceCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None,
|
|
93
95
|
"metadata": obj.get("metadata")
|
|
94
96
|
})
|
|
@@ -17,17 +17,18 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class TagFilter(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
Filter for document tags supporting inclusion and exclusion. Note: The exclude list takes priority over the include list. If a document has a tag that appears in both lists, the document will be excluded. Examples: - Include only documents with 'red' OR 'blue' tags: {\"include\": [\"red\", \"blue\"]} - Exclude documents with 'red' OR 'blue' tags: {\"exclude\": [\"red\", \"blue\"]} - Include documents with 'color' tag BUT exclude 'red' and 'blue': {\"include\": [\"color\"], \"exclude\": [\"red\", \"blue\"]}
|
|
28
28
|
""" # noqa: E501
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
include: Optional[List[StrictStr]] = Field(default=None, description="Include documents with ANY of these tags (OR operation).")
|
|
30
|
+
exclude: Optional[List[StrictStr]] = Field(default=None, description="Exclude documents with ANY of these tags (OR operation). Takes priority over include.")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["include", "exclude"]
|
|
31
32
|
|
|
32
33
|
model_config = ConfigDict(
|
|
33
34
|
populate_by_name=True,
|
|
@@ -47,7 +48,7 @@ class CreateTopicModelJobRequest(BaseModel):
|
|
|
47
48
|
|
|
48
49
|
@classmethod
|
|
49
50
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
-
"""Create an instance of
|
|
51
|
+
"""Create an instance of TagFilter from a JSON string"""
|
|
51
52
|
return cls.from_dict(json.loads(json_str))
|
|
52
53
|
|
|
53
54
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -72,7 +73,7 @@ class CreateTopicModelJobRequest(BaseModel):
|
|
|
72
73
|
|
|
73
74
|
@classmethod
|
|
74
75
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
-
"""Create an instance of
|
|
76
|
+
"""Create an instance of TagFilter from a dict"""
|
|
76
77
|
if obj is None:
|
|
77
78
|
return None
|
|
78
79
|
|
|
@@ -80,7 +81,8 @@ class CreateTopicModelJobRequest(BaseModel):
|
|
|
80
81
|
return cls.model_validate(obj)
|
|
81
82
|
|
|
82
83
|
_obj = cls.model_validate({
|
|
83
|
-
"
|
|
84
|
+
"include": obj.get("include"),
|
|
85
|
+
"exclude": obj.get("exclude")
|
|
84
86
|
})
|
|
85
87
|
return _obj
|
|
86
88
|
|
h2ogpte/rest_sync/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "1.
|
|
17
|
+
__version__ = "1.7.0-dev1"
|
|
18
18
|
|
|
19
19
|
# import apis into sdk package
|
|
20
20
|
from h2ogpte.rest_sync.api.api_keys_api import APIKeysApi
|
|
@@ -69,6 +69,7 @@ from h2ogpte.rest_sync.models.chat_message_reference import ChatMessageReference
|
|
|
69
69
|
from h2ogpte.rest_sync.models.chat_session import ChatSession
|
|
70
70
|
from h2ogpte.rest_sync.models.chat_session_update_request import ChatSessionUpdateRequest
|
|
71
71
|
from h2ogpte.rest_sync.models.chat_settings import ChatSettings
|
|
72
|
+
from h2ogpte.rest_sync.models.chat_settings_tags import ChatSettingsTags
|
|
72
73
|
from h2ogpte.rest_sync.models.chunk import Chunk
|
|
73
74
|
from h2ogpte.rest_sync.models.chunk_search_result import ChunkSearchResult
|
|
74
75
|
from h2ogpte.rest_sync.models.collection import Collection
|
|
@@ -88,7 +89,6 @@ from h2ogpte.rest_sync.models.create_import_collection_to_collection_job_request
|
|
|
88
89
|
from h2ogpte.rest_sync.models.create_insert_document_to_collection_job_request import CreateInsertDocumentToCollectionJobRequest
|
|
89
90
|
from h2ogpte.rest_sync.models.create_secret201_response import CreateSecret201Response
|
|
90
91
|
from h2ogpte.rest_sync.models.create_secret_request import CreateSecretRequest
|
|
91
|
-
from h2ogpte.rest_sync.models.create_topic_model_job_request import CreateTopicModelJobRequest
|
|
92
92
|
from h2ogpte.rest_sync.models.delete_chat_sessions_job_request import DeleteChatSessionsJobRequest
|
|
93
93
|
from h2ogpte.rest_sync.models.delete_collections_job_request import DeleteCollectionsJobRequest
|
|
94
94
|
from h2ogpte.rest_sync.models.delete_documents_job_request import DeleteDocumentsJobRequest
|
|
@@ -158,6 +158,7 @@ from h2ogpte.rest_sync.models.suggested_question import SuggestedQuestion
|
|
|
158
158
|
from h2ogpte.rest_sync.models.summarize_request import SummarizeRequest
|
|
159
159
|
from h2ogpte.rest_sync.models.tag import Tag
|
|
160
160
|
from h2ogpte.rest_sync.models.tag_create_request import TagCreateRequest
|
|
161
|
+
from h2ogpte.rest_sync.models.tag_filter import TagFilter
|
|
161
162
|
from h2ogpte.rest_sync.models.tag_update_request import TagUpdateRequest
|
|
162
163
|
from h2ogpte.rest_sync.models.update_agent_key_request import UpdateAgentKeyRequest
|
|
163
164
|
from h2ogpte.rest_sync.models.update_agent_tool_preference_request import UpdateAgentToolPreferenceRequest
|
|
@@ -16,7 +16,7 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
|
18
18
|
|
|
19
|
-
from pydantic import Field, StrictBytes, StrictInt, StrictStr
|
|
19
|
+
from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator
|
|
20
20
|
from typing import List, Optional, Tuple, Union
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
22
|
from h2ogpte.rest_sync.models.add_custom_agent_tool201_response_inner import AddCustomAgentTool201ResponseInner
|
|
@@ -54,11 +54,11 @@ class AgentsApi:
|
|
|
54
54
|
@validate_call
|
|
55
55
|
def add_custom_agent_tool(
|
|
56
56
|
self,
|
|
57
|
-
tool_type: StrictStr,
|
|
58
|
-
tool_args: StrictStr,
|
|
59
|
-
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
57
|
+
tool_type: Annotated[StrictStr, Field(description="The type of custom tool being added: - local_mcp: Model Context Protocol server running locally - remote_mcp: Model Context Protocol server running remotely - browser_action: Custom browser automation actions - general_code: General purpose code execution tools ")],
|
|
58
|
+
tool_args: Annotated[StrictStr, Field(description="JSON string containing tool-specific arguments. The structure varies by tool_type: For remote_mcp: { \\\"mcp_config_json\\\": \\\"JSON string with MCP server configuration\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true) } For local_mcp, browser_action, and general_code: { \\\"tool_name\\\": \\\"string (optional, defaults to filename without extension)\\\", \\\"description\\\": \\\"string (optional, tool description)\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true), \\\"should_unzip\\\": true/false (optional, for general_code .zip files only), \\\"tool_usage_mode\\\": [\\\"runner\\\", \\\"creator\\\"] (optional list of strings) } ")],
|
|
59
|
+
file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The tool file to upload. Requirements vary by tool_type: - local_mcp: .zip file containing MCP server code - remote_mcp: Optional .json file with MCP configuration - browser_action: .py file (must start with 'browser_') or .zip containing browser action scripts - general_code: .py or .zip file with custom code ")] = None,
|
|
60
60
|
custom_tool_path: Optional[StrictStr] = None,
|
|
61
|
-
filename: Optional[StrictStr] = None,
|
|
61
|
+
filename: Annotated[Optional[StrictStr], Field(description="Optional filename to use when storing the uploaded file")] = None,
|
|
62
62
|
_request_timeout: Union[
|
|
63
63
|
None,
|
|
64
64
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -76,15 +76,15 @@ class AgentsApi:
|
|
|
76
76
|
|
|
77
77
|
Add Custom Agent Tools
|
|
78
78
|
|
|
79
|
-
:param tool_type: (required)
|
|
79
|
+
:param tool_type: The type of custom tool being added: - local_mcp: Model Context Protocol server running locally - remote_mcp: Model Context Protocol server running remotely - browser_action: Custom browser automation actions - general_code: General purpose code execution tools (required)
|
|
80
80
|
:type tool_type: str
|
|
81
|
-
:param tool_args: (required)
|
|
81
|
+
:param tool_args: JSON string containing tool-specific arguments. The structure varies by tool_type: For remote_mcp: { \\\"mcp_config_json\\\": \\\"JSON string with MCP server configuration\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true) } For local_mcp, browser_action, and general_code: { \\\"tool_name\\\": \\\"string (optional, defaults to filename without extension)\\\", \\\"description\\\": \\\"string (optional, tool description)\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true), \\\"should_unzip\\\": true/false (optional, for general_code .zip files only), \\\"tool_usage_mode\\\": [\\\"runner\\\", \\\"creator\\\"] (optional list of strings) } (required)
|
|
82
82
|
:type tool_args: str
|
|
83
|
-
:param file:
|
|
83
|
+
:param file: The tool file to upload. Requirements vary by tool_type: - local_mcp: .zip file containing MCP server code - remote_mcp: Optional .json file with MCP configuration - browser_action: .py file (must start with 'browser_') or .zip containing browser action scripts - general_code: .py or .zip file with custom code
|
|
84
84
|
:type file: bytearray
|
|
85
85
|
:param custom_tool_path:
|
|
86
86
|
:type custom_tool_path: str
|
|
87
|
-
:param filename:
|
|
87
|
+
:param filename: Optional filename to use when storing the uploaded file
|
|
88
88
|
:type filename: str
|
|
89
89
|
:param _request_timeout: timeout setting for this request. If one
|
|
90
90
|
number provided, it will be total request
|
|
@@ -138,11 +138,11 @@ class AgentsApi:
|
|
|
138
138
|
@validate_call
|
|
139
139
|
def add_custom_agent_tool_with_http_info(
|
|
140
140
|
self,
|
|
141
|
-
tool_type: StrictStr,
|
|
142
|
-
tool_args: StrictStr,
|
|
143
|
-
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
141
|
+
tool_type: Annotated[StrictStr, Field(description="The type of custom tool being added: - local_mcp: Model Context Protocol server running locally - remote_mcp: Model Context Protocol server running remotely - browser_action: Custom browser automation actions - general_code: General purpose code execution tools ")],
|
|
142
|
+
tool_args: Annotated[StrictStr, Field(description="JSON string containing tool-specific arguments. The structure varies by tool_type: For remote_mcp: { \\\"mcp_config_json\\\": \\\"JSON string with MCP server configuration\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true) } For local_mcp, browser_action, and general_code: { \\\"tool_name\\\": \\\"string (optional, defaults to filename without extension)\\\", \\\"description\\\": \\\"string (optional, tool description)\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true), \\\"should_unzip\\\": true/false (optional, for general_code .zip files only), \\\"tool_usage_mode\\\": [\\\"runner\\\", \\\"creator\\\"] (optional list of strings) } ")],
|
|
143
|
+
file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The tool file to upload. Requirements vary by tool_type: - local_mcp: .zip file containing MCP server code - remote_mcp: Optional .json file with MCP configuration - browser_action: .py file (must start with 'browser_') or .zip containing browser action scripts - general_code: .py or .zip file with custom code ")] = None,
|
|
144
144
|
custom_tool_path: Optional[StrictStr] = None,
|
|
145
|
-
filename: Optional[StrictStr] = None,
|
|
145
|
+
filename: Annotated[Optional[StrictStr], Field(description="Optional filename to use when storing the uploaded file")] = None,
|
|
146
146
|
_request_timeout: Union[
|
|
147
147
|
None,
|
|
148
148
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -160,15 +160,15 @@ class AgentsApi:
|
|
|
160
160
|
|
|
161
161
|
Add Custom Agent Tools
|
|
162
162
|
|
|
163
|
-
:param tool_type: (required)
|
|
163
|
+
:param tool_type: The type of custom tool being added: - local_mcp: Model Context Protocol server running locally - remote_mcp: Model Context Protocol server running remotely - browser_action: Custom browser automation actions - general_code: General purpose code execution tools (required)
|
|
164
164
|
:type tool_type: str
|
|
165
|
-
:param tool_args: (required)
|
|
165
|
+
:param tool_args: JSON string containing tool-specific arguments. The structure varies by tool_type: For remote_mcp: { \\\"mcp_config_json\\\": \\\"JSON string with MCP server configuration\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true) } For local_mcp, browser_action, and general_code: { \\\"tool_name\\\": \\\"string (optional, defaults to filename without extension)\\\", \\\"description\\\": \\\"string (optional, tool description)\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true), \\\"should_unzip\\\": true/false (optional, for general_code .zip files only), \\\"tool_usage_mode\\\": [\\\"runner\\\", \\\"creator\\\"] (optional list of strings) } (required)
|
|
166
166
|
:type tool_args: str
|
|
167
|
-
:param file:
|
|
167
|
+
:param file: The tool file to upload. Requirements vary by tool_type: - local_mcp: .zip file containing MCP server code - remote_mcp: Optional .json file with MCP configuration - browser_action: .py file (must start with 'browser_') or .zip containing browser action scripts - general_code: .py or .zip file with custom code
|
|
168
168
|
:type file: bytearray
|
|
169
169
|
:param custom_tool_path:
|
|
170
170
|
:type custom_tool_path: str
|
|
171
|
-
:param filename:
|
|
171
|
+
:param filename: Optional filename to use when storing the uploaded file
|
|
172
172
|
:type filename: str
|
|
173
173
|
:param _request_timeout: timeout setting for this request. If one
|
|
174
174
|
number provided, it will be total request
|
|
@@ -222,11 +222,11 @@ class AgentsApi:
|
|
|
222
222
|
@validate_call
|
|
223
223
|
def add_custom_agent_tool_without_preload_content(
|
|
224
224
|
self,
|
|
225
|
-
tool_type: StrictStr,
|
|
226
|
-
tool_args: StrictStr,
|
|
227
|
-
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
225
|
+
tool_type: Annotated[StrictStr, Field(description="The type of custom tool being added: - local_mcp: Model Context Protocol server running locally - remote_mcp: Model Context Protocol server running remotely - browser_action: Custom browser automation actions - general_code: General purpose code execution tools ")],
|
|
226
|
+
tool_args: Annotated[StrictStr, Field(description="JSON string containing tool-specific arguments. The structure varies by tool_type: For remote_mcp: { \\\"mcp_config_json\\\": \\\"JSON string with MCP server configuration\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true) } For local_mcp, browser_action, and general_code: { \\\"tool_name\\\": \\\"string (optional, defaults to filename without extension)\\\", \\\"description\\\": \\\"string (optional, tool description)\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true), \\\"should_unzip\\\": true/false (optional, for general_code .zip files only), \\\"tool_usage_mode\\\": [\\\"runner\\\", \\\"creator\\\"] (optional list of strings) } ")],
|
|
227
|
+
file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The tool file to upload. Requirements vary by tool_type: - local_mcp: .zip file containing MCP server code - remote_mcp: Optional .json file with MCP configuration - browser_action: .py file (must start with 'browser_') or .zip containing browser action scripts - general_code: .py or .zip file with custom code ")] = None,
|
|
228
228
|
custom_tool_path: Optional[StrictStr] = None,
|
|
229
|
-
filename: Optional[StrictStr] = None,
|
|
229
|
+
filename: Annotated[Optional[StrictStr], Field(description="Optional filename to use when storing the uploaded file")] = None,
|
|
230
230
|
_request_timeout: Union[
|
|
231
231
|
None,
|
|
232
232
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -244,15 +244,15 @@ class AgentsApi:
|
|
|
244
244
|
|
|
245
245
|
Add Custom Agent Tools
|
|
246
246
|
|
|
247
|
-
:param tool_type: (required)
|
|
247
|
+
:param tool_type: The type of custom tool being added: - local_mcp: Model Context Protocol server running locally - remote_mcp: Model Context Protocol server running remotely - browser_action: Custom browser automation actions - general_code: General purpose code execution tools (required)
|
|
248
248
|
:type tool_type: str
|
|
249
|
-
:param tool_args: (required)
|
|
249
|
+
:param tool_args: JSON string containing tool-specific arguments. The structure varies by tool_type: For remote_mcp: { \\\"mcp_config_json\\\": \\\"JSON string with MCP server configuration\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true) } For local_mcp, browser_action, and general_code: { \\\"tool_name\\\": \\\"string (optional, defaults to filename without extension)\\\", \\\"description\\\": \\\"string (optional, tool description)\\\", \\\"enable_by_default\\\": true/false (optional, defaults to true), \\\"should_unzip\\\": true/false (optional, for general_code .zip files only), \\\"tool_usage_mode\\\": [\\\"runner\\\", \\\"creator\\\"] (optional list of strings) } (required)
|
|
250
250
|
:type tool_args: str
|
|
251
|
-
:param file:
|
|
251
|
+
:param file: The tool file to upload. Requirements vary by tool_type: - local_mcp: .zip file containing MCP server code - remote_mcp: Optional .json file with MCP configuration - browser_action: .py file (must start with 'browser_') or .zip containing browser action scripts - general_code: .py or .zip file with custom code
|
|
252
252
|
:type file: bytearray
|
|
253
253
|
:param custom_tool_path:
|
|
254
254
|
:type custom_tool_path: str
|
|
255
|
-
:param filename:
|
|
255
|
+
:param filename: Optional filename to use when storing the uploaded file
|
|
256
256
|
:type filename: str
|
|
257
257
|
:param _request_timeout: timeout setting for this request. If one
|
|
258
258
|
number provided, it will be total request
|