relaxai 0.5.1__tar.gz → 0.5.2__tar.gz
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.
Potentially problematic release.
This version of relaxai might be problematic. Click here for more details.
- relaxai-0.5.2/.release-please-manifest.json +3 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/CHANGELOG.md +8 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/PKG-INFO +1 -1
- {relaxai-0.5.1 → relaxai-0.5.2}/api.md +2 -2
- {relaxai-0.5.1 → relaxai-0.5.2}/pyproject.toml +1 -1
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_version.py +1 -1
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/resources/deep_research.py +6 -7
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/resources/tools.py +6 -7
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/__init__.py +2 -0
- relaxai-0.5.2/src/relaxai/types/deepresearch_response.py +115 -0
- relaxai-0.5.2/src/relaxai/types/tool_response.py +33 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/api_resources/test_deep_research.py +10 -8
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/api_resources/test_tools.py +10 -8
- relaxai-0.5.1/.release-please-manifest.json +0 -3
- {relaxai-0.5.1 → relaxai-0.5.2}/.gitignore +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/CONTRIBUTING.md +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/LICENSE +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/README.md +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/SECURITY.md +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/bin/check-release-environment +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/bin/publish-pypi +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/examples/.keep +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/noxfile.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/release-please-config.json +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/requirements-dev.lock +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/requirements.lock +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/__init__.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_base_client.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_client.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_compat.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_constants.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_exceptions.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_files.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_models.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_qs.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_resource.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_response.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_streaming.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_types.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/__init__.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_compat.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_datetime_parse.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_logs.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_proxy.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_reflection.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_resources_proxy.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_streams.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_sync.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_transform.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_typing.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/_utils/_utils.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/lib/.keep +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/py.typed +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/resources/__init__.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/resources/chat.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/resources/embeddings.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/resources/models.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/chat_completion_message.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/chat_completion_message_param.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/chat_completion_response.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/chat_create_completion_params.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/content_filter_results.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/deep_research_create_params.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/embedding_create_embedding_params.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/embedding_response.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/function_call.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/function_call_param.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/function_definition_param.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/health_response.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/model.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/model_list.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/shared/__init__.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/shared/openai_completion_tokens_details.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/shared/openai_prompt_tokens_details.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/shared/openai_usage.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/stream_options_param.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/tool_execute_code_params.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/__init__.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/api_resources/__init__.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/api_resources/test_chat.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/api_resources/test_client.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/api_resources/test_embeddings.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/api_resources/test_models.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/conftest.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/sample_file.txt +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_client.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_deepcopy.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_extract_files.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_files.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_models.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_qs.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_required_args.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_response.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_streaming.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_transform.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_utils/test_datetime_parse.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_utils/test_proxy.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/test_utils/test_typing.py +0 -0
- {relaxai-0.5.1 → relaxai-0.5.2}/tests/utils.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.2 (2025-10-15)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.5.1...v0.5.2](https://github.com/relax-ai/python-sdk/compare/v0.5.1...v0.5.2)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **api:** Change 200 response format ([01fa29f](https://github.com/relax-ai/python-sdk/commit/01fa29ff96f513a6d0e03ecc65b361f5a0f115fd))
|
|
10
|
+
|
|
3
11
|
## 0.5.1 (2025-10-15)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.5.0...v0.5.1](https://github.com/relax-ai/python-sdk/compare/v0.5.0...v0.5.1)
|
|
@@ -71,7 +71,7 @@ from relaxai.types import ToolRequest, ToolResponse
|
|
|
71
71
|
|
|
72
72
|
Methods:
|
|
73
73
|
|
|
74
|
-
- <code title="post /v1/tools/code">client.tools.<a href="./src/relaxai/resources/tools.py">execute_code</a>(\*\*<a href="src/relaxai/types/tool_execute_code_params.py">params</a>) ->
|
|
74
|
+
- <code title="post /v1/tools/code">client.tools.<a href="./src/relaxai/resources/tools.py">execute_code</a>(\*\*<a href="src/relaxai/types/tool_execute_code_params.py">params</a>) -> <a href="./src/relaxai/types/tool_response.py">ToolResponse</a></code>
|
|
75
75
|
|
|
76
76
|
# DeepResearch
|
|
77
77
|
|
|
@@ -83,4 +83,4 @@ from relaxai.types import DeepresearchRequest, DeepresearchResponse
|
|
|
83
83
|
|
|
84
84
|
Methods:
|
|
85
85
|
|
|
86
|
-
- <code title="post /v1/deep-research">client.deep_research.<a href="./src/relaxai/resources/deep_research.py">create</a>(\*\*<a href="src/relaxai/types/deep_research_create_params.py">params</a>) ->
|
|
86
|
+
- <code title="post /v1/deep-research">client.deep_research.<a href="./src/relaxai/resources/deep_research.py">create</a>(\*\*<a href="src/relaxai/types/deep_research_create_params.py">params</a>) -> <a href="./src/relaxai/types/deepresearch_response.py">DeepresearchResponse</a></code>
|
|
@@ -7,7 +7,7 @@ from typing import Iterable
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
9
|
from ..types import deep_research_create_params
|
|
10
|
-
from .._types import Body, Omit, Query, Headers,
|
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from .._compat import cached_property
|
|
13
13
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -19,6 +19,7 @@ from .._response import (
|
|
|
19
19
|
)
|
|
20
20
|
from .._base_client import make_request_options
|
|
21
21
|
from ..types.stream_options_param import StreamOptionsParam
|
|
22
|
+
from ..types.deepresearch_response import DeepresearchResponse
|
|
22
23
|
from ..types.chat_completion_message_param import ChatCompletionMessageParam
|
|
23
24
|
|
|
24
25
|
__all__ = ["DeepResearchResource", "AsyncDeepResearchResource"]
|
|
@@ -64,7 +65,7 @@ class DeepResearchResource(SyncAPIResource):
|
|
|
64
65
|
extra_query: Query | None = None,
|
|
65
66
|
extra_body: Body | None = None,
|
|
66
67
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
67
|
-
) ->
|
|
68
|
+
) -> DeepresearchResponse:
|
|
68
69
|
"""
|
|
69
70
|
Performs deep research on a given topic and returns a detailed report.
|
|
70
71
|
|
|
@@ -77,7 +78,6 @@ class DeepResearchResource(SyncAPIResource):
|
|
|
77
78
|
|
|
78
79
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
79
80
|
"""
|
|
80
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
81
81
|
return self._post(
|
|
82
82
|
"/v1/deep-research",
|
|
83
83
|
body=maybe_transform(
|
|
@@ -99,7 +99,7 @@ class DeepResearchResource(SyncAPIResource):
|
|
|
99
99
|
options=make_request_options(
|
|
100
100
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
101
101
|
),
|
|
102
|
-
cast_to=
|
|
102
|
+
cast_to=DeepresearchResponse,
|
|
103
103
|
)
|
|
104
104
|
|
|
105
105
|
|
|
@@ -143,7 +143,7 @@ class AsyncDeepResearchResource(AsyncAPIResource):
|
|
|
143
143
|
extra_query: Query | None = None,
|
|
144
144
|
extra_body: Body | None = None,
|
|
145
145
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
146
|
-
) ->
|
|
146
|
+
) -> DeepresearchResponse:
|
|
147
147
|
"""
|
|
148
148
|
Performs deep research on a given topic and returns a detailed report.
|
|
149
149
|
|
|
@@ -156,7 +156,6 @@ class AsyncDeepResearchResource(AsyncAPIResource):
|
|
|
156
156
|
|
|
157
157
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
158
158
|
"""
|
|
159
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
160
159
|
return await self._post(
|
|
161
160
|
"/v1/deep-research",
|
|
162
161
|
body=await async_maybe_transform(
|
|
@@ -178,7 +177,7 @@ class AsyncDeepResearchResource(AsyncAPIResource):
|
|
|
178
177
|
options=make_request_options(
|
|
179
178
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
180
179
|
),
|
|
181
|
-
cast_to=
|
|
180
|
+
cast_to=DeepresearchResponse,
|
|
182
181
|
)
|
|
183
182
|
|
|
184
183
|
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
7
|
from ..types import tool_execute_code_params
|
|
8
|
-
from .._types import Body, Omit, Query, Headers,
|
|
8
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
9
9
|
from .._utils import maybe_transform, async_maybe_transform
|
|
10
10
|
from .._compat import cached_property
|
|
11
11
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -16,6 +16,7 @@ from .._response import (
|
|
|
16
16
|
async_to_streamed_response_wrapper,
|
|
17
17
|
)
|
|
18
18
|
from .._base_client import make_request_options
|
|
19
|
+
from ..types.tool_response import ToolResponse
|
|
19
20
|
|
|
20
21
|
__all__ = ["ToolsResource", "AsyncToolsResource"]
|
|
21
22
|
|
|
@@ -52,7 +53,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
52
53
|
extra_query: Query | None = None,
|
|
53
54
|
extra_body: Body | None = None,
|
|
54
55
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
55
|
-
) ->
|
|
56
|
+
) -> ToolResponse:
|
|
56
57
|
"""
|
|
57
58
|
Run the given code in a secure environment and return the output.
|
|
58
59
|
|
|
@@ -65,7 +66,6 @@ class ToolsResource(SyncAPIResource):
|
|
|
65
66
|
|
|
66
67
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
67
68
|
"""
|
|
68
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
69
69
|
return self._post(
|
|
70
70
|
"/v1/tools/code",
|
|
71
71
|
body=maybe_transform(
|
|
@@ -79,7 +79,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
79
79
|
options=make_request_options(
|
|
80
80
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
81
81
|
),
|
|
82
|
-
cast_to=
|
|
82
|
+
cast_to=ToolResponse,
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
|
|
@@ -115,7 +115,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
115
115
|
extra_query: Query | None = None,
|
|
116
116
|
extra_body: Body | None = None,
|
|
117
117
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
118
|
-
) ->
|
|
118
|
+
) -> ToolResponse:
|
|
119
119
|
"""
|
|
120
120
|
Run the given code in a secure environment and return the output.
|
|
121
121
|
|
|
@@ -128,7 +128,6 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
128
128
|
|
|
129
129
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
130
130
|
"""
|
|
131
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
132
131
|
return await self._post(
|
|
133
132
|
"/v1/tools/code",
|
|
134
133
|
body=await async_maybe_transform(
|
|
@@ -142,7 +141,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
142
141
|
options=make_request_options(
|
|
143
142
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
144
143
|
),
|
|
145
|
-
cast_to=
|
|
144
|
+
cast_to=ToolResponse,
|
|
146
145
|
)
|
|
147
146
|
|
|
148
147
|
|
|
@@ -10,10 +10,12 @@ from .shared import (
|
|
|
10
10
|
)
|
|
11
11
|
from .model_list import ModelList as ModelList
|
|
12
12
|
from .function_call import FunctionCall as FunctionCall
|
|
13
|
+
from .tool_response import ToolResponse as ToolResponse
|
|
13
14
|
from .health_response import HealthResponse as HealthResponse
|
|
14
15
|
from .embedding_response import EmbeddingResponse as EmbeddingResponse
|
|
15
16
|
from .function_call_param import FunctionCallParam as FunctionCallParam
|
|
16
17
|
from .stream_options_param import StreamOptionsParam as StreamOptionsParam
|
|
18
|
+
from .deepresearch_response import DeepresearchResponse as DeepresearchResponse
|
|
17
19
|
from .content_filter_results import ContentFilterResults as ContentFilterResults
|
|
18
20
|
from .chat_completion_message import ChatCompletionMessage as ChatCompletionMessage
|
|
19
21
|
from .chat_completion_response import ChatCompletionResponse as ChatCompletionResponse
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
from .function_call import FunctionCall
|
|
7
|
+
from .shared.openai_usage import OpenAIUsage
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"DeepresearchResponse",
|
|
11
|
+
"Choice",
|
|
12
|
+
"ChoiceMessage",
|
|
13
|
+
"ChoiceMessageAnnotation",
|
|
14
|
+
"ChoiceMessageAnnotationURLCitation",
|
|
15
|
+
"ChoiceMessageToolCall",
|
|
16
|
+
"ChoiceLogprobs",
|
|
17
|
+
"ChoiceLogprobsContent",
|
|
18
|
+
"ChoiceLogprobsContentTopLogprob",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ChoiceMessageAnnotationURLCitation(BaseModel):
|
|
23
|
+
end_index: int
|
|
24
|
+
|
|
25
|
+
start_index: int
|
|
26
|
+
|
|
27
|
+
title: str
|
|
28
|
+
|
|
29
|
+
url: str
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ChoiceMessageAnnotation(BaseModel):
|
|
33
|
+
type: str
|
|
34
|
+
|
|
35
|
+
url_citation: Optional[ChoiceMessageAnnotationURLCitation] = None
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class ChoiceMessageToolCall(BaseModel):
|
|
39
|
+
function: FunctionCall
|
|
40
|
+
|
|
41
|
+
type: str
|
|
42
|
+
|
|
43
|
+
id: Optional[str] = None
|
|
44
|
+
|
|
45
|
+
index: Optional[int] = None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class ChoiceMessage(BaseModel):
|
|
49
|
+
role: str
|
|
50
|
+
|
|
51
|
+
annotations: Optional[List[ChoiceMessageAnnotation]] = None
|
|
52
|
+
|
|
53
|
+
content: Optional[str] = None
|
|
54
|
+
|
|
55
|
+
function_call: Optional[FunctionCall] = None
|
|
56
|
+
|
|
57
|
+
name: Optional[str] = None
|
|
58
|
+
|
|
59
|
+
reasoning_content: Optional[str] = None
|
|
60
|
+
|
|
61
|
+
refusal: Optional[str] = None
|
|
62
|
+
|
|
63
|
+
tool_call_id: Optional[str] = None
|
|
64
|
+
|
|
65
|
+
tool_calls: Optional[List[ChoiceMessageToolCall]] = None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class ChoiceLogprobsContentTopLogprob(BaseModel):
|
|
69
|
+
token: str
|
|
70
|
+
|
|
71
|
+
logprob: float
|
|
72
|
+
|
|
73
|
+
bytes: Optional[str] = None
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class ChoiceLogprobsContent(BaseModel):
|
|
77
|
+
token: str
|
|
78
|
+
|
|
79
|
+
logprob: float
|
|
80
|
+
|
|
81
|
+
top_logprobs: List[ChoiceLogprobsContentTopLogprob]
|
|
82
|
+
|
|
83
|
+
bytes: Optional[str] = None
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class ChoiceLogprobs(BaseModel):
|
|
87
|
+
content: List[ChoiceLogprobsContent]
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class Choice(BaseModel):
|
|
91
|
+
finish_reason: str
|
|
92
|
+
|
|
93
|
+
index: int
|
|
94
|
+
|
|
95
|
+
message: ChoiceMessage
|
|
96
|
+
|
|
97
|
+
logprobs: Optional[ChoiceLogprobs] = None
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class DeepresearchResponse(BaseModel):
|
|
101
|
+
id: str
|
|
102
|
+
|
|
103
|
+
choices: List[Choice]
|
|
104
|
+
|
|
105
|
+
created: int
|
|
106
|
+
|
|
107
|
+
model: str
|
|
108
|
+
|
|
109
|
+
object: str
|
|
110
|
+
|
|
111
|
+
system_fingerprint: str
|
|
112
|
+
|
|
113
|
+
usage: OpenAIUsage
|
|
114
|
+
|
|
115
|
+
service_tier: Optional[str] = None
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ToolResponse", "Plot"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Plot(BaseModel):
|
|
11
|
+
content_base64: str
|
|
12
|
+
|
|
13
|
+
filename: str
|
|
14
|
+
|
|
15
|
+
format: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ToolResponse(BaseModel):
|
|
19
|
+
execution_time: float
|
|
20
|
+
|
|
21
|
+
exit_code: int
|
|
22
|
+
|
|
23
|
+
security_checked: bool
|
|
24
|
+
|
|
25
|
+
stderr: str
|
|
26
|
+
|
|
27
|
+
stdout: str
|
|
28
|
+
|
|
29
|
+
success: bool
|
|
30
|
+
|
|
31
|
+
plots: Optional[List[Plot]] = None
|
|
32
|
+
|
|
33
|
+
violations: Optional[List[str]] = None
|
|
@@ -8,6 +8,8 @@ from typing import Any, cast
|
|
|
8
8
|
import pytest
|
|
9
9
|
|
|
10
10
|
from relaxai import Relaxai, AsyncRelaxai
|
|
11
|
+
from tests.utils import assert_matches_type
|
|
12
|
+
from relaxai.types import DeepresearchResponse
|
|
11
13
|
|
|
12
14
|
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
|
13
15
|
|
|
@@ -27,7 +29,7 @@ class TestDeepResearch:
|
|
|
27
29
|
],
|
|
28
30
|
model="model",
|
|
29
31
|
)
|
|
30
|
-
|
|
32
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
31
33
|
|
|
32
34
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
33
35
|
@parametrize
|
|
@@ -108,7 +110,7 @@ class TestDeepResearch:
|
|
|
108
110
|
],
|
|
109
111
|
top_p=0,
|
|
110
112
|
)
|
|
111
|
-
|
|
113
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
112
114
|
|
|
113
115
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
114
116
|
@parametrize
|
|
@@ -126,7 +128,7 @@ class TestDeepResearch:
|
|
|
126
128
|
assert response.is_closed is True
|
|
127
129
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
128
130
|
deep_research = response.parse()
|
|
129
|
-
|
|
131
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
130
132
|
|
|
131
133
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
132
134
|
@parametrize
|
|
@@ -144,7 +146,7 @@ class TestDeepResearch:
|
|
|
144
146
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
145
147
|
|
|
146
148
|
deep_research = response.parse()
|
|
147
|
-
|
|
149
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
148
150
|
|
|
149
151
|
assert cast(Any, response.is_closed) is True
|
|
150
152
|
|
|
@@ -166,7 +168,7 @@ class TestAsyncDeepResearch:
|
|
|
166
168
|
],
|
|
167
169
|
model="model",
|
|
168
170
|
)
|
|
169
|
-
|
|
171
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
170
172
|
|
|
171
173
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
172
174
|
@parametrize
|
|
@@ -247,7 +249,7 @@ class TestAsyncDeepResearch:
|
|
|
247
249
|
],
|
|
248
250
|
top_p=0,
|
|
249
251
|
)
|
|
250
|
-
|
|
252
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
251
253
|
|
|
252
254
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
253
255
|
@parametrize
|
|
@@ -265,7 +267,7 @@ class TestAsyncDeepResearch:
|
|
|
265
267
|
assert response.is_closed is True
|
|
266
268
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
267
269
|
deep_research = await response.parse()
|
|
268
|
-
|
|
270
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
269
271
|
|
|
270
272
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
271
273
|
@parametrize
|
|
@@ -283,6 +285,6 @@ class TestAsyncDeepResearch:
|
|
|
283
285
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
284
286
|
|
|
285
287
|
deep_research = await response.parse()
|
|
286
|
-
|
|
288
|
+
assert_matches_type(DeepresearchResponse, deep_research, path=["response"])
|
|
287
289
|
|
|
288
290
|
assert cast(Any, response.is_closed) is True
|
|
@@ -8,6 +8,8 @@ from typing import Any, cast
|
|
|
8
8
|
import pytest
|
|
9
9
|
|
|
10
10
|
from relaxai import Relaxai, AsyncRelaxai
|
|
11
|
+
from tests.utils import assert_matches_type
|
|
12
|
+
from relaxai.types import ToolResponse
|
|
11
13
|
|
|
12
14
|
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
|
13
15
|
|
|
@@ -22,7 +24,7 @@ class TestTools:
|
|
|
22
24
|
code="code",
|
|
23
25
|
lang="lang",
|
|
24
26
|
)
|
|
25
|
-
|
|
27
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
26
28
|
|
|
27
29
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
28
30
|
@parametrize
|
|
@@ -32,7 +34,7 @@ class TestTools:
|
|
|
32
34
|
lang="lang",
|
|
33
35
|
libraries=["string"],
|
|
34
36
|
)
|
|
35
|
-
|
|
37
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
36
38
|
|
|
37
39
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
38
40
|
@parametrize
|
|
@@ -45,7 +47,7 @@ class TestTools:
|
|
|
45
47
|
assert response.is_closed is True
|
|
46
48
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
47
49
|
tool = response.parse()
|
|
48
|
-
|
|
50
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
49
51
|
|
|
50
52
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
51
53
|
@parametrize
|
|
@@ -58,7 +60,7 @@ class TestTools:
|
|
|
58
60
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
59
61
|
|
|
60
62
|
tool = response.parse()
|
|
61
|
-
|
|
63
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
62
64
|
|
|
63
65
|
assert cast(Any, response.is_closed) is True
|
|
64
66
|
|
|
@@ -75,7 +77,7 @@ class TestAsyncTools:
|
|
|
75
77
|
code="code",
|
|
76
78
|
lang="lang",
|
|
77
79
|
)
|
|
78
|
-
|
|
80
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
79
81
|
|
|
80
82
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
81
83
|
@parametrize
|
|
@@ -85,7 +87,7 @@ class TestAsyncTools:
|
|
|
85
87
|
lang="lang",
|
|
86
88
|
libraries=["string"],
|
|
87
89
|
)
|
|
88
|
-
|
|
90
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
89
91
|
|
|
90
92
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
91
93
|
@parametrize
|
|
@@ -98,7 +100,7 @@ class TestAsyncTools:
|
|
|
98
100
|
assert response.is_closed is True
|
|
99
101
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
100
102
|
tool = await response.parse()
|
|
101
|
-
|
|
103
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
102
104
|
|
|
103
105
|
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
104
106
|
@parametrize
|
|
@@ -111,6 +113,6 @@ class TestAsyncTools:
|
|
|
111
113
|
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
112
114
|
|
|
113
115
|
tool = await response.parse()
|
|
114
|
-
|
|
116
|
+
assert_matches_type(ToolResponse, tool, path=["response"])
|
|
115
117
|
|
|
116
118
|
assert cast(Any, response.is_closed) is True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{relaxai-0.5.1 → relaxai-0.5.2}/src/relaxai/types/shared/openai_completion_tokens_details.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|