h2ogpte 1.6.53rc2__py3-none-any.whl → 1.6.54__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 +1 -55
- h2ogpte/h2ogpte_async.py +1 -55
- h2ogpte/rest_async/__init__.py +1 -3
- h2ogpte/rest_async/api/agents_api.py +25 -25
- h2ogpte/rest_async/api_client.py +1 -1
- h2ogpte/rest_async/configuration.py +1 -1
- h2ogpte/rest_async/models/__init__.py +0 -2
- h2ogpte/rest_async/models/chat_completion_request.py +2 -6
- h2ogpte/rest_async/models/chat_settings.py +2 -6
- h2ogpte/rest_async/models/ingest_from_confluence_body.py +2 -4
- h2ogpte/rest_sync/__init__.py +1 -3
- h2ogpte/rest_sync/api/agents_api.py +25 -25
- h2ogpte/rest_sync/api_client.py +1 -1
- h2ogpte/rest_sync/configuration.py +1 -1
- h2ogpte/rest_sync/models/__init__.py +0 -2
- h2ogpte/rest_sync/models/chat_completion_request.py +2 -6
- h2ogpte/rest_sync/models/chat_settings.py +2 -6
- h2ogpte/rest_sync/models/ingest_from_confluence_body.py +2 -4
- h2ogpte/session.py +6 -10
- h2ogpte/session_async.py +3 -8
- h2ogpte/types.py +1 -16
- {h2ogpte-1.6.53rc2.dist-info → h2ogpte-1.6.54.dist-info}/METADATA +1 -1
- {h2ogpte-1.6.53rc2.dist-info → h2ogpte-1.6.54.dist-info}/RECORD +27 -31
- h2ogpte/rest_async/models/chat_settings_tags.py +0 -140
- h2ogpte/rest_async/models/tag_filter.py +0 -89
- h2ogpte/rest_sync/models/chat_settings_tags.py +0 -140
- h2ogpte/rest_sync/models/tag_filter.py +0 -89
- {h2ogpte-1.6.53rc2.dist-info → h2ogpte-1.6.54.dist-info}/WHEEL +0 -0
- {h2ogpte-1.6.53rc2.dist-info → h2ogpte-1.6.54.dist-info}/entry_points.txt +0 -0
- {h2ogpte-1.6.53rc2.dist-info → h2ogpte-1.6.54.dist-info}/top_level.txt +0 -0
h2ogpte/__init__.py
CHANGED
h2ogpte/h2ogpte.py
CHANGED
|
@@ -2496,7 +2496,6 @@ class H2OGPTE(H2OGPTESyncBase):
|
|
|
2496
2496
|
base_url: str,
|
|
2497
2497
|
page_id: Union[str, List[str]],
|
|
2498
2498
|
credentials: ConfluenceCredential,
|
|
2499
|
-
include_attachments: Union[bool, None] = None,
|
|
2500
2499
|
gen_doc_summaries: Union[bool, None] = None,
|
|
2501
2500
|
gen_doc_questions: Union[bool, None] = None,
|
|
2502
2501
|
audio_input_language: Union[str, None] = None,
|
|
@@ -2520,8 +2519,6 @@ class H2OGPTE(H2OGPTESyncBase):
|
|
|
2520
2519
|
The page id or ids of pages to be ingested.
|
|
2521
2520
|
credentials:
|
|
2522
2521
|
The object with Confluence credentials.
|
|
2523
|
-
include_attachments:
|
|
2524
|
-
A flag indicating whether to also ingest attachments with the page.
|
|
2525
2522
|
gen_doc_summaries:
|
|
2526
2523
|
Whether to auto-generate document summaries (uses LLM)
|
|
2527
2524
|
gen_doc_questions:
|
|
@@ -2563,7 +2560,6 @@ class H2OGPTE(H2OGPTESyncBase):
|
|
|
2563
2560
|
page_ids=[page_id] if isinstance(page_id, str) else page_id,
|
|
2564
2561
|
credentials=rest.ConfluenceCredentials(**credentials.__dict__),
|
|
2565
2562
|
metadata=metadata,
|
|
2566
|
-
include_attachments=include_attachments,
|
|
2567
2563
|
),
|
|
2568
2564
|
gen_doc_summaries=gen_doc_summaries,
|
|
2569
2565
|
gen_doc_questions=gen_doc_questions,
|
|
@@ -2745,20 +2741,7 @@ class H2OGPTE(H2OGPTESyncBase):
|
|
|
2745
2741
|
handwriting_check:
|
|
2746
2742
|
Check pages for handwriting. Will use specialized models if handwriting is found.
|
|
2747
2743
|
metadata:
|
|
2748
|
-
|
|
2749
|
-
from the upload_ids list, and each value is a dictionary of metadata key-value
|
|
2750
|
-
pairs to associate with that document.
|
|
2751
|
-
|
|
2752
|
-
Example::
|
|
2753
|
-
|
|
2754
|
-
# Single document
|
|
2755
|
-
metadata = {upload_id: {"category": "reports", "year": "2024"}}
|
|
2756
|
-
|
|
2757
|
-
# Multiple documents
|
|
2758
|
-
metadata = {
|
|
2759
|
-
upload_id_1: {"category": "reports"},
|
|
2760
|
-
upload_id_2: {"category": "invoices"}
|
|
2761
|
-
}
|
|
2744
|
+
Metadata to be associated with the document.
|
|
2762
2745
|
timeout:
|
|
2763
2746
|
Timeout in seconds.
|
|
2764
2747
|
ingest_mode:
|
|
@@ -4531,8 +4514,6 @@ class H2OGPTE(H2OGPTESyncBase):
|
|
|
4531
4514
|
Requires 1 LLM or Agent call.
|
|
4532
4515
|
:code:`"agent_only"` Agent Only - Answer the query with only original files passed to agent.
|
|
4533
4516
|
Requires 1 Agent call.
|
|
4534
|
-
:code:`"agentic_rag"` Agentic RAG - Agent with RAG tool that retrieves and answers from collection.
|
|
4535
|
-
Requires 1 Agent call with RAG tool execution.
|
|
4536
4517
|
:code:`"rag"` RAG (Retrieval Augmented Generation) - Use supporting document contexts
|
|
4537
4518
|
to answer the query. Requires 1 LLM or Agent call.
|
|
4538
4519
|
:code:`"hyde1"` LLM Only + RAG composite - HyDE RAG (Hypothetical Document Embedding).
|
|
@@ -7151,41 +7132,6 @@ class H2OGPTE(H2OGPTESyncBase):
|
|
|
7151
7132
|
def add_custom_agent_tool(
|
|
7152
7133
|
self, tool_type: str, tool_args: dict, custom_tool_path: Optional[str] = None
|
|
7153
7134
|
) -> list:
|
|
7154
|
-
"""Adds a custom agent tool.
|
|
7155
|
-
|
|
7156
|
-
Args:
|
|
7157
|
-
tool_type: The type of custom tool being added. Valid values:
|
|
7158
|
-
- 'local_mcp': Model Context Protocol server running locally
|
|
7159
|
-
- 'remote_mcp': Model Context Protocol server running remotely
|
|
7160
|
-
- 'browser_action': Custom browser automation actions
|
|
7161
|
-
- 'general_code': General purpose code execution tools
|
|
7162
|
-
|
|
7163
|
-
tool_args: Dictionary containing tool-specific arguments. Structure varies by tool_type:
|
|
7164
|
-
|
|
7165
|
-
For 'remote_mcp':
|
|
7166
|
-
{
|
|
7167
|
-
"mcp_config_json": "JSON string with MCP server configuration",
|
|
7168
|
-
"enable_by_default": True/False (optional, defaults to True)
|
|
7169
|
-
}
|
|
7170
|
-
|
|
7171
|
-
For 'local_mcp', 'browser_action', and 'general_code':
|
|
7172
|
-
{
|
|
7173
|
-
"tool_name": "string (optional, defaults to filename without extension)",
|
|
7174
|
-
"description": "string (optional, tool description)",
|
|
7175
|
-
"enable_by_default": True/False (optional, defaults to True),
|
|
7176
|
-
"should_unzip": True/False (optional, for general_code .zip files only),
|
|
7177
|
-
"tool_usage_mode": ["runner", "creator"] (optional list of strings, for remote_mcp)
|
|
7178
|
-
}
|
|
7179
|
-
|
|
7180
|
-
custom_tool_path: Path to the tool file to upload (optional). Requirements vary by tool_type:
|
|
7181
|
-
- 'local_mcp': .zip file containing MCP server code
|
|
7182
|
-
- 'remote_mcp': Optional .json file with MCP configuration
|
|
7183
|
-
- 'browser_action': .py file (must start with 'browser_') or .zip containing browser action scripts
|
|
7184
|
-
- 'general_code': .py or .zip file with custom code
|
|
7185
|
-
|
|
7186
|
-
Returns:
|
|
7187
|
-
list: List of created custom agent tool IDs
|
|
7188
|
-
"""
|
|
7189
7135
|
header = self._get_auth_header()
|
|
7190
7136
|
custom_tool_path = str(custom_tool_path) if custom_tool_path else None
|
|
7191
7137
|
with self._RESTClient(self) as rest_client:
|
h2ogpte/h2ogpte_async.py
CHANGED
|
@@ -2698,7 +2698,6 @@ class H2OGPTEAsync:
|
|
|
2698
2698
|
base_url: str,
|
|
2699
2699
|
page_id: Union[str, List[str]],
|
|
2700
2700
|
credentials: ConfluenceCredential,
|
|
2701
|
-
include_attachments: Union[bool, None] = None,
|
|
2702
2701
|
gen_doc_summaries: Union[bool, None] = None,
|
|
2703
2702
|
gen_doc_questions: Union[bool, None] = None,
|
|
2704
2703
|
audio_input_language: Union[str, None] = None,
|
|
@@ -2722,8 +2721,6 @@ class H2OGPTEAsync:
|
|
|
2722
2721
|
The page id or ids of pages to be ingested.
|
|
2723
2722
|
credentials:
|
|
2724
2723
|
The object with Confluence credentials.
|
|
2725
|
-
include_attachments:
|
|
2726
|
-
A flag indicating whether to also ingest attachments with the page.
|
|
2727
2724
|
gen_doc_summaries:
|
|
2728
2725
|
Whether to auto-generate document summaries (uses LLM)
|
|
2729
2726
|
gen_doc_questions:
|
|
@@ -2765,7 +2762,6 @@ class H2OGPTEAsync:
|
|
|
2765
2762
|
page_ids=[page_id] if isinstance(page_id, str) else page_id,
|
|
2766
2763
|
credentials=rest.ConfluenceCredentials(**credentials.__dict__),
|
|
2767
2764
|
metadata=metadata,
|
|
2768
|
-
include_attachments=include_attachments,
|
|
2769
2765
|
),
|
|
2770
2766
|
gen_doc_summaries=gen_doc_summaries,
|
|
2771
2767
|
gen_doc_questions=gen_doc_questions,
|
|
@@ -2943,20 +2939,7 @@ class H2OGPTEAsync:
|
|
|
2943
2939
|
handwriting_check:
|
|
2944
2940
|
Check pages for handwriting. Will use specialized models if handwriting is found.
|
|
2945
2941
|
metadata:
|
|
2946
|
-
|
|
2947
|
-
from the upload_ids list, and each value is a dictionary of metadata key-value
|
|
2948
|
-
pairs to associate with that document.
|
|
2949
|
-
|
|
2950
|
-
Example::
|
|
2951
|
-
|
|
2952
|
-
# Single document
|
|
2953
|
-
metadata = {upload_id: {"category": "reports", "year": "2024"}}
|
|
2954
|
-
|
|
2955
|
-
# Multiple documents
|
|
2956
|
-
metadata = {
|
|
2957
|
-
upload_id_1: {"category": "reports"},
|
|
2958
|
-
upload_id_2: {"category": "invoices"}
|
|
2959
|
-
}
|
|
2942
|
+
Metadata to be associated with the document.
|
|
2960
2943
|
timeout:
|
|
2961
2944
|
Timeout in seconds.
|
|
2962
2945
|
ingest_mode:
|
|
@@ -4739,8 +4722,6 @@ class H2OGPTEAsync:
|
|
|
4739
4722
|
Requires 1 LLM or Agent call.
|
|
4740
4723
|
:code:`"agent_only"` Agent Only - Answer the query with only original files passed to agent.
|
|
4741
4724
|
Requires 1 Agent call.
|
|
4742
|
-
:code:`"agentic_rag"` Agentic RAG - Agent with RAG tool that retrieves and answers from collection.
|
|
4743
|
-
Requires 1 Agent call with RAG tool execution.
|
|
4744
4725
|
:code:`"rag"` RAG (Retrieval Augmented Generation) - Use supporting document contexts
|
|
4745
4726
|
to answer the query. Requires 1 LLM or Agent call.
|
|
4746
4727
|
:code:`"hyde1"` LLM Only + RAG composite - HyDE RAG (Hypothetical Document Embedding).
|
|
@@ -7406,41 +7387,6 @@ class H2OGPTEAsync:
|
|
|
7406
7387
|
async def add_custom_agent_tool(
|
|
7407
7388
|
self, tool_type: str, tool_args: dict, custom_tool_path: Optional[str] = None
|
|
7408
7389
|
) -> list:
|
|
7409
|
-
"""Adds a custom agent tool.
|
|
7410
|
-
|
|
7411
|
-
Args:
|
|
7412
|
-
tool_type: The type of custom tool being added. Valid values:
|
|
7413
|
-
- 'local_mcp': Model Context Protocol server running locally
|
|
7414
|
-
- 'remote_mcp': Model Context Protocol server running remotely
|
|
7415
|
-
- 'browser_action': Custom browser automation actions
|
|
7416
|
-
- 'general_code': General purpose code execution tools
|
|
7417
|
-
|
|
7418
|
-
tool_args: Dictionary containing tool-specific arguments. Structure varies by tool_type:
|
|
7419
|
-
|
|
7420
|
-
For 'remote_mcp':
|
|
7421
|
-
{
|
|
7422
|
-
"mcp_config_json": "JSON string with MCP server configuration",
|
|
7423
|
-
"enable_by_default": True/False (optional, defaults to True)
|
|
7424
|
-
}
|
|
7425
|
-
|
|
7426
|
-
For 'local_mcp', 'browser_action', and 'general_code':
|
|
7427
|
-
{
|
|
7428
|
-
"tool_name": "string (optional, defaults to filename without extension)",
|
|
7429
|
-
"description": "string (optional, tool description)",
|
|
7430
|
-
"enable_by_default": True/False (optional, defaults to True),
|
|
7431
|
-
"should_unzip": True/False (optional, for general_code .zip files only),
|
|
7432
|
-
"tool_usage_mode": ["runner", "creator"] (optional list of strings, for remote_mcp)
|
|
7433
|
-
}
|
|
7434
|
-
|
|
7435
|
-
custom_tool_path: Path to the tool file to upload (optional). Requirements vary by tool_type:
|
|
7436
|
-
- 'local_mcp': .zip file containing MCP server code
|
|
7437
|
-
- 'remote_mcp': Optional .json file with MCP configuration
|
|
7438
|
-
- 'browser_action': .py file (must start with 'browser_') or .zip containing browser action scripts
|
|
7439
|
-
- 'general_code': .py or .zip file with custom code
|
|
7440
|
-
|
|
7441
|
-
Returns:
|
|
7442
|
-
list: List of created custom agent tool IDs
|
|
7443
|
-
"""
|
|
7444
7390
|
header = await self._get_auth_header()
|
|
7445
7391
|
custom_tool_path = str(custom_tool_path) if custom_tool_path else None
|
|
7446
7392
|
async with self._RESTClient(self) as rest_client:
|
h2ogpte/rest_async/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "1.6.
|
|
17
|
+
__version__ = "1.6.54"
|
|
18
18
|
|
|
19
19
|
# import apis into sdk package
|
|
20
20
|
from h2ogpte.rest_async.api.api_keys_api import APIKeysApi
|
|
@@ -69,7 +69,6 @@ from h2ogpte.rest_async.models.chat_message_reference import ChatMessageReferenc
|
|
|
69
69
|
from h2ogpte.rest_async.models.chat_session import ChatSession
|
|
70
70
|
from h2ogpte.rest_async.models.chat_session_update_request import ChatSessionUpdateRequest
|
|
71
71
|
from h2ogpte.rest_async.models.chat_settings import ChatSettings
|
|
72
|
-
from h2ogpte.rest_async.models.chat_settings_tags import ChatSettingsTags
|
|
73
72
|
from h2ogpte.rest_async.models.chunk import Chunk
|
|
74
73
|
from h2ogpte.rest_async.models.chunk_search_result import ChunkSearchResult
|
|
75
74
|
from h2ogpte.rest_async.models.collection import Collection
|
|
@@ -159,7 +158,6 @@ from h2ogpte.rest_async.models.suggested_question import SuggestedQuestion
|
|
|
159
158
|
from h2ogpte.rest_async.models.summarize_request import SummarizeRequest
|
|
160
159
|
from h2ogpte.rest_async.models.tag import Tag
|
|
161
160
|
from h2ogpte.rest_async.models.tag_create_request import TagCreateRequest
|
|
162
|
-
from h2ogpte.rest_async.models.tag_filter import TagFilter
|
|
163
161
|
from h2ogpte.rest_async.models.tag_update_request import TagUpdateRequest
|
|
164
162
|
from h2ogpte.rest_async.models.update_agent_key_request import UpdateAgentKeyRequest
|
|
165
163
|
from h2ogpte.rest_async.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
|
|
20
20
|
from typing import List, Optional, Tuple, Union
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
22
|
from h2ogpte.rest_async.models.add_custom_agent_tool201_response_inner import AddCustomAgentTool201ResponseInner
|
|
@@ -54,11 +54,11 @@ class AgentsApi:
|
|
|
54
54
|
@validate_call
|
|
55
55
|
async def add_custom_agent_tool(
|
|
56
56
|
self,
|
|
57
|
-
tool_type:
|
|
58
|
-
tool_args:
|
|
59
|
-
file:
|
|
57
|
+
tool_type: StrictStr,
|
|
58
|
+
tool_args: StrictStr,
|
|
59
|
+
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
60
60
|
custom_tool_path: Optional[StrictStr] = None,
|
|
61
|
-
filename:
|
|
61
|
+
filename: Optional[StrictStr] = 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:
|
|
79
|
+
:param tool_type: (required)
|
|
80
80
|
:type tool_type: str
|
|
81
|
-
:param tool_args:
|
|
81
|
+
:param tool_args: (required)
|
|
82
82
|
:type tool_args: str
|
|
83
|
-
:param file:
|
|
83
|
+
:param file:
|
|
84
84
|
:type file: bytearray
|
|
85
85
|
:param custom_tool_path:
|
|
86
86
|
:type custom_tool_path: str
|
|
87
|
-
:param filename:
|
|
87
|
+
:param filename:
|
|
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
|
async def add_custom_agent_tool_with_http_info(
|
|
140
140
|
self,
|
|
141
|
-
tool_type:
|
|
142
|
-
tool_args:
|
|
143
|
-
file:
|
|
141
|
+
tool_type: StrictStr,
|
|
142
|
+
tool_args: StrictStr,
|
|
143
|
+
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
144
144
|
custom_tool_path: Optional[StrictStr] = None,
|
|
145
|
-
filename:
|
|
145
|
+
filename: Optional[StrictStr] = 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:
|
|
163
|
+
:param tool_type: (required)
|
|
164
164
|
:type tool_type: str
|
|
165
|
-
:param tool_args:
|
|
165
|
+
:param tool_args: (required)
|
|
166
166
|
:type tool_args: str
|
|
167
|
-
:param file:
|
|
167
|
+
:param file:
|
|
168
168
|
:type file: bytearray
|
|
169
169
|
:param custom_tool_path:
|
|
170
170
|
:type custom_tool_path: str
|
|
171
|
-
:param filename:
|
|
171
|
+
:param filename:
|
|
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
|
async def add_custom_agent_tool_without_preload_content(
|
|
224
224
|
self,
|
|
225
|
-
tool_type:
|
|
226
|
-
tool_args:
|
|
227
|
-
file:
|
|
225
|
+
tool_type: StrictStr,
|
|
226
|
+
tool_args: StrictStr,
|
|
227
|
+
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
228
228
|
custom_tool_path: Optional[StrictStr] = None,
|
|
229
|
-
filename:
|
|
229
|
+
filename: Optional[StrictStr] = 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:
|
|
247
|
+
:param tool_type: (required)
|
|
248
248
|
:type tool_type: str
|
|
249
|
-
:param tool_args:
|
|
249
|
+
:param tool_args: (required)
|
|
250
250
|
:type tool_args: str
|
|
251
|
-
:param file:
|
|
251
|
+
:param file:
|
|
252
252
|
:type file: bytearray
|
|
253
253
|
:param custom_tool_path:
|
|
254
254
|
:type custom_tool_path: str
|
|
255
|
-
:param filename:
|
|
255
|
+
:param filename:
|
|
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
|
h2ogpte/rest_async/api_client.py
CHANGED
|
@@ -90,7 +90,7 @@ class ApiClient:
|
|
|
90
90
|
self.default_headers[header_name] = header_value
|
|
91
91
|
self.cookie = cookie
|
|
92
92
|
# Set default User-Agent.
|
|
93
|
-
self.user_agent = 'OpenAPI-Generator/1.6.
|
|
93
|
+
self.user_agent = 'OpenAPI-Generator/1.6.54/python'
|
|
94
94
|
self.client_side_validation = configuration.client_side_validation
|
|
95
95
|
|
|
96
96
|
async def __aenter__(self):
|
|
@@ -499,7 +499,7 @@ class Configuration:
|
|
|
499
499
|
"OS: {env}\n"\
|
|
500
500
|
"Python Version: {pyversion}\n"\
|
|
501
501
|
"Version of the API: v1.0.0\n"\
|
|
502
|
-
"SDK Package Version: 1.6.
|
|
502
|
+
"SDK Package Version: 1.6.54".\
|
|
503
503
|
format(env=sys.platform, pyversion=sys.version)
|
|
504
504
|
|
|
505
505
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -38,7 +38,6 @@ from h2ogpte.rest_async.models.chat_message_reference import ChatMessageReferenc
|
|
|
38
38
|
from h2ogpte.rest_async.models.chat_session import ChatSession
|
|
39
39
|
from h2ogpte.rest_async.models.chat_session_update_request import ChatSessionUpdateRequest
|
|
40
40
|
from h2ogpte.rest_async.models.chat_settings import ChatSettings
|
|
41
|
-
from h2ogpte.rest_async.models.chat_settings_tags import ChatSettingsTags
|
|
42
41
|
from h2ogpte.rest_async.models.chunk import Chunk
|
|
43
42
|
from h2ogpte.rest_async.models.chunk_search_result import ChunkSearchResult
|
|
44
43
|
from h2ogpte.rest_async.models.collection import Collection
|
|
@@ -128,7 +127,6 @@ from h2ogpte.rest_async.models.suggested_question import SuggestedQuestion
|
|
|
128
127
|
from h2ogpte.rest_async.models.summarize_request import SummarizeRequest
|
|
129
128
|
from h2ogpte.rest_async.models.tag import Tag
|
|
130
129
|
from h2ogpte.rest_async.models.tag_create_request import TagCreateRequest
|
|
131
|
-
from h2ogpte.rest_async.models.tag_filter import TagFilter
|
|
132
130
|
from h2ogpte.rest_async.models.tag_update_request import TagUpdateRequest
|
|
133
131
|
from h2ogpte.rest_async.models.update_agent_key_request import UpdateAgentKeyRequest
|
|
134
132
|
from h2ogpte.rest_async.models.update_agent_tool_preference_request import UpdateAgentToolPreferenceRequest
|
|
@@ -19,7 +19,6 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from h2ogpte.rest_async.models.chat_settings_tags import ChatSettingsTags
|
|
23
22
|
from typing import Optional, Set
|
|
24
23
|
from typing_extensions import Self
|
|
25
24
|
|
|
@@ -38,7 +37,7 @@ class ChatCompletionRequest(BaseModel):
|
|
|
38
37
|
self_reflection_config: Optional[Dict[str, Any]] = Field(default=None, description="A map with self reflection settings: * `llm_reflection` **(type=string, example=gpt-4-0613)** * `prompt_reflection` **(type=string, example=\\\"\\\"\\\"Prompt:\\\\\\\\n%s\\\\\\\\n\\\"\\\"\\\"\\\\\\\\n\\\\\\\\n\\\"\\\"\\\")** * `system_prompt_reflection` **(type=string)** * `llm_args_reflection` **(type=string, example={})** ")
|
|
39
38
|
rag_config: Optional[Dict[str, Any]] = Field(default=None, description="A map with arguments to control RAG (retrieval-augmented-generation) types.: * `rag_type` **(type=enum[auto, llm_only, rag, hyde1, hyde2, rag+, all_data])** RAG type options: * `auto` - Automatically select the best rag_type. * `llm_only` LLM Only - Answer the query without any supporting document contexts. Requires 1 LLM call. * `rag` RAG (Retrieval Augmented Generation) - Use supporting document contexts to answer the query. Requires 1 LLM call. * `hyde1` LLM Only + RAG composite - HyDE RAG (Hypothetical Document Embedding). Use 'LLM Only' response to find relevant contexts from a collection for generating a response. Requires 2 LLM calls. * `hyde2` HyDE + RAG composite - Use the 'HyDE RAG' response to find relevant contexts from a collection for generating a response. Requires 3 LLM calls. * `rag+` Summary RAG - Like RAG, but uses more context and recursive summarization to overcome LLM context limits. Keeps all retrieved chunks, puts them in order, adds neighboring chunks, then uses the summary API to get the answer. Can require several LLM calls. * `all_data` All Data RAG - Like Summary RAG, but includes all document chunks. Uses recursive summarization to overcome LLM context limits. Can require several LLM calls. * `hyde_no_rag_llm_prompt_extension` **(type=string, example=\\\\\\\\nKeep the answer brief, and list the 5 most relevant key words at the end.)** - Add this prompt to every user's prompt, when generating answers to be used for subsequent retrieval during HyDE. Only used when rag_type is `hyde1` or `hyde2`. * `num_neighbor_chunks_to_include` **(type=integer, default=1)** - A number of neighboring chunks to include for every retrieved relevant chunk. It helps to keep surrounding context together. Only enabled for rag_type `rag+`. * `meta_data_to_include` **(type=map)** - A map with flags that indicate whether each piece of document metadata is to be included as part of the context for a chat with a collection. * `name` **(type: boolean, default=True)** * `text` **(type: boolean, default=True)** * `page` **(type: boolean, default=True)** * `captions` **(type: boolean, default=True)** * `uri` **(type: boolean, default=False)** * `connector` **(type: boolean, default=False)** * `original_mtime` **(type: boolean, default=False)** * `age` **(type: boolean, default=False)** * `score` **(type: boolean, default=False)** * `rag_max_chunks` **(type=integer, default=-1)** - Maximum number of document chunks to retrieve for RAG. Actual number depends on rag_type and admin configuration. Set to >0 values to enable. Can be combined with rag_min_chunk_score. * `rag_min_chunk_score` **(type=double, default=0.0)** - Minimum score of document chunks to retrieve for RAG. Set to >0 values to enable. Can be combined with rag_max_chunks. ")
|
|
40
39
|
include_chat_history: Optional[StrictStr] = Field(default=None, description="Whether to include chat history. Includes previous questions and answers for the current chat session for each new chat request. Disable if require deterministic answers for a given question.")
|
|
41
|
-
tags: Optional[
|
|
40
|
+
tags: Optional[List[StrictStr]] = Field(default=None, description="A list of tags from which to pull the context for RAG.")
|
|
42
41
|
__properties: ClassVar[List[str]] = ["message", "system_prompt", "pre_prompt_query", "prompt_query", "image_batch_final_prompt", "image_batch_image_prompt", "llm", "llm_args", "self_reflection_config", "rag_config", "include_chat_history", "tags"]
|
|
43
42
|
|
|
44
43
|
@field_validator('include_chat_history')
|
|
@@ -90,9 +89,6 @@ class ChatCompletionRequest(BaseModel):
|
|
|
90
89
|
exclude=excluded_fields,
|
|
91
90
|
exclude_none=True,
|
|
92
91
|
)
|
|
93
|
-
# override the default output from pydantic by calling `to_dict()` of tags
|
|
94
|
-
if self.tags:
|
|
95
|
-
_dict['tags'] = self.tags.to_dict()
|
|
96
92
|
return _dict
|
|
97
93
|
|
|
98
94
|
@classmethod
|
|
@@ -116,7 +112,7 @@ class ChatCompletionRequest(BaseModel):
|
|
|
116
112
|
"self_reflection_config": obj.get("self_reflection_config"),
|
|
117
113
|
"rag_config": obj.get("rag_config"),
|
|
118
114
|
"include_chat_history": obj.get("include_chat_history"),
|
|
119
|
-
"tags":
|
|
115
|
+
"tags": obj.get("tags"),
|
|
120
116
|
})
|
|
121
117
|
return _obj
|
|
122
118
|
|
|
@@ -19,7 +19,6 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from h2ogpte.rest_async.models.chat_settings_tags import ChatSettingsTags
|
|
23
22
|
from typing import Optional, Set
|
|
24
23
|
from typing_extensions import Self
|
|
25
24
|
|
|
@@ -32,7 +31,7 @@ class ChatSettings(BaseModel):
|
|
|
32
31
|
self_reflection_config: Optional[Dict[str, Any]] = Field(default=None, description="A map with self reflection settings: * `llm_reflection` **(type=string, example=gpt-4-0613)** * `prompt_reflection` **(type=string, example=\\\"\\\"\\\"Prompt:\\\\\\\\n%s\\\\\\\\n\\\"\\\"\\\"\\\\\\\\n\\\\\\\\n\\\"\\\"\\\")** * `system_prompt_reflection` **(type=string)** * `llm_args_reflection` **(type=string, example={})** ")
|
|
33
32
|
rag_config: Optional[Dict[str, Any]] = Field(default=None, description="A map with arguments to control RAG (retrieval-augmented-generation) types.: * `rag_type` **(type=enum[auto, llm_only, rag, hyde1, hyde2, rag+, all_data])** RAG type options: * `auto` - Automatically select the best rag_type. * `llm_only` LLM Only - Answer the query without any supporting document contexts. Requires 1 LLM call. * `rag` RAG (Retrieval Augmented Generation) - Use supporting document contexts to answer the query. Requires 1 LLM call. * `hyde1` LLM Only + RAG composite - HyDE RAG (Hypothetical Document Embedding). Use 'LLM Only' response to find relevant contexts from a collection for generating a response. Requires 2 LLM calls. * `hyde2` HyDE + RAG composite - Use the 'HyDE RAG' response to find relevant contexts from a collection for generating a response. Requires 3 LLM calls. * `rag+` Summary RAG - Like RAG, but uses more context and recursive summarization to overcome LLM context limits. Keeps all retrieved chunks, puts them in order, adds neighboring chunks, then uses the summary API to get the answer. Can require several LLM calls. * `all_data` All Data RAG - Like Summary RAG, but includes all document chunks. Uses recursive summarization to overcome LLM context limits. Can require several LLM calls. * `hyde_no_rag_llm_prompt_extension` **(type=string, example=\\\\\\\\nKeep the answer brief, and list the 5 most relevant key words at the end.)** - Add this prompt to every user's prompt, when generating answers to be used for subsequent retrieval during HyDE. Only used when rag_type is `hyde1` or `hyde2`. * `num_neighbor_chunks_to_include` **(type=integer, default=1)** - A number of neighboring chunks to include for every retrieved relevant chunk. It helps to keep surrounding context together. Only enabled for rag_type `rag+`. * `meta_data_to_include` **(type=map)** - A map with flags that indicate whether each piece of document metadata is to be included as part of the context for a chat with a collection. * `name` **(type: boolean, default=True)** * `text` **(type: boolean, default=True)** * `page` **(type: boolean, default=True)** * `captions` **(type: boolean, default=True)** * `uri` **(type: boolean, default=False)** * `connector` **(type: boolean, default=False)** * `original_mtime` **(type: boolean, default=False)** * `age` **(type: boolean, default=False)** * `score` **(type: boolean, default=False)** * `rag_max_chunks` **(type=integer, default=-1)** - Maximum number of document chunks to retrieve for RAG. Actual number depends on rag_type and admin configuration. Set to >0 values to enable. Can be combined with rag_min_chunk_score. * `rag_min_chunk_score` **(type=double, default=0.0)** - Minimum score of document chunks to retrieve for RAG. Set to >0 values to enable. Can be combined with rag_max_chunks. ")
|
|
34
33
|
include_chat_history: Optional[StrictStr] = Field(default=None, description="Whether to include chat history. Includes previous questions and answers for the current chat session for each new chat request. Disable if require deterministic answers for a given question.")
|
|
35
|
-
tags: Optional[
|
|
34
|
+
tags: Optional[List[StrictStr]] = Field(default=None, description="A list of tags from which to pull the context for RAG.")
|
|
36
35
|
__properties: ClassVar[List[str]] = ["llm", "llm_args", "self_reflection_config", "rag_config", "include_chat_history", "tags"]
|
|
37
36
|
|
|
38
37
|
@field_validator('include_chat_history')
|
|
@@ -84,9 +83,6 @@ class ChatSettings(BaseModel):
|
|
|
84
83
|
exclude=excluded_fields,
|
|
85
84
|
exclude_none=True,
|
|
86
85
|
)
|
|
87
|
-
# override the default output from pydantic by calling `to_dict()` of tags
|
|
88
|
-
if self.tags:
|
|
89
|
-
_dict['tags'] = self.tags.to_dict()
|
|
90
86
|
return _dict
|
|
91
87
|
|
|
92
88
|
@classmethod
|
|
@@ -104,7 +100,7 @@ class ChatSettings(BaseModel):
|
|
|
104
100
|
"self_reflection_config": obj.get("self_reflection_config"),
|
|
105
101
|
"rag_config": obj.get("rag_config"),
|
|
106
102
|
"include_chat_history": obj.get("include_chat_history"),
|
|
107
|
-
"tags":
|
|
103
|
+
"tags": obj.get("tags")
|
|
108
104
|
})
|
|
109
105
|
return _obj
|
|
110
106
|
|
|
@@ -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,
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, 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,10 +29,9 @@ 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.")
|
|
33
32
|
credentials: ConfluenceCredentials
|
|
34
33
|
metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata for the documents.")
|
|
35
|
-
__properties: ClassVar[List[str]] = ["base_url", "page_ids", "
|
|
34
|
+
__properties: ClassVar[List[str]] = ["base_url", "page_ids", "credentials", "metadata"]
|
|
36
35
|
|
|
37
36
|
model_config = ConfigDict(
|
|
38
37
|
populate_by_name=True,
|
|
@@ -90,7 +89,6 @@ class IngestFromConfluenceBody(BaseModel):
|
|
|
90
89
|
_obj = cls.model_validate({
|
|
91
90
|
"base_url": obj.get("base_url"),
|
|
92
91
|
"page_ids": obj.get("page_ids"),
|
|
93
|
-
"include_attachments": obj.get("include_attachments") if obj.get("include_attachments") is not None else False,
|
|
94
92
|
"credentials": ConfluenceCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None,
|
|
95
93
|
"metadata": obj.get("metadata")
|
|
96
94
|
})
|
h2ogpte/rest_sync/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "1.6.
|
|
17
|
+
__version__ = "1.6.54"
|
|
18
18
|
|
|
19
19
|
# import apis into sdk package
|
|
20
20
|
from h2ogpte.rest_sync.api.api_keys_api import APIKeysApi
|
|
@@ -69,7 +69,6 @@ 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
|
|
73
72
|
from h2ogpte.rest_sync.models.chunk import Chunk
|
|
74
73
|
from h2ogpte.rest_sync.models.chunk_search_result import ChunkSearchResult
|
|
75
74
|
from h2ogpte.rest_sync.models.collection import Collection
|
|
@@ -159,7 +158,6 @@ from h2ogpte.rest_sync.models.suggested_question import SuggestedQuestion
|
|
|
159
158
|
from h2ogpte.rest_sync.models.summarize_request import SummarizeRequest
|
|
160
159
|
from h2ogpte.rest_sync.models.tag import Tag
|
|
161
160
|
from h2ogpte.rest_sync.models.tag_create_request import TagCreateRequest
|
|
162
|
-
from h2ogpte.rest_sync.models.tag_filter import TagFilter
|
|
163
161
|
from h2ogpte.rest_sync.models.tag_update_request import TagUpdateRequest
|
|
164
162
|
from h2ogpte.rest_sync.models.update_agent_key_request import UpdateAgentKeyRequest
|
|
165
163
|
from h2ogpte.rest_sync.models.update_agent_tool_preference_request import UpdateAgentToolPreferenceRequest
|