Skip to content

Commit bf08f11

Browse files
author
潘婉宁
committed
fix: support fc
1 parent 86eace7 commit bf08f11

File tree

7 files changed

+14
-5
lines changed

7 files changed

+14
-5
lines changed

volcenginesdkarkruntime/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from ._client import Ark, AsyncArk
2-
from ._utils._logs import setup_logging as _setup_logging
3-
2+
from ._utils import setup_logging as _setup_logging
3+
from .common import pydantic_function_tool
44

55
__all__ = ["Ark", "AsyncArk"]
66

volcenginesdkarkruntime/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _load_api_key(
379379

380380

381381
class CertificateResponse(BaseModel):
382-
error: Optional[Dict[str,str]] = None
382+
error: Optional[Dict[str, str]] = None
383383
"""The error information."""
384384

385385
Certificate: str

volcenginesdkarkruntime/_utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@
5555
maybe_transform as maybe_transform,
5656
async_maybe_transform as async_maybe_transform,
5757
)
58+
from ._logs import setup_logging as setup_logging

volcenginesdkarkruntime/common/_parsing/_completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,6 @@ def type_to_response_format_param(
274274
"json_schema": {
275275
"schema": to_strict_json_schema(json_schema_type),
276276
"name": name,
277-
"strict": False,
277+
"strict": True,
278278
},
279279
}

volcenginesdkarkruntime/common/_parsing/_responses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def type_to_text_format_param(type_: type) -> ResponseFormatTextConfigParam:
4444

4545
return {
4646
"type": "json_schema",
47-
"strict": False,
47+
"strict": True,
4848
"name": response_format_dict["json_schema"]["name"],
4949
"schema": response_format_dict["json_schema"]["schema"],
5050
}

volcenginesdkarkruntime/types/shared_params/function_definition.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Required, TypedDict
67

78
from ...types import shared_params
@@ -32,3 +33,10 @@ class FunctionDefinition(TypedDict, total=False):
3233
3334
Omitting `parameters` defines a function with an empty parameter list.
3435
"""
36+
strict: Optional[bool]
37+
"""Whether to enable strict schema adherence when generating the function call.
38+
39+
If set to true, the model will follow the exact schema defined in the
40+
`parameters` field. Only a subset of JSON Schema is supported when `strict` is
41+
`true`.
42+
"""

volcenginesdkexamples/volcenginesdkarkruntime/parsing_tools.py

Whitespace-only changes.

0 commit comments

Comments
 (0)