mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-04-28 20:50:07 +00:00
feat(api): api update
This commit is contained in:
parent
10a8dac1d7
commit
c75867efe7
6 changed files with 19 additions and 8 deletions
|
|
@ -3,11 +3,10 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Dict
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ..types import app_log_params
|
||||
from ..types import LogLevel, app_log_params
|
||||
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from .._utils import maybe_transform, async_maybe_transform
|
||||
from .._compat import cached_property
|
||||
|
|
@ -20,6 +19,7 @@ from .._response import (
|
|||
)
|
||||
from ..types.app import App
|
||||
from .._base_client import make_request_options
|
||||
from ..types.log_level import LogLevel
|
||||
from ..types.app_log_response import AppLogResponse
|
||||
from ..types.app_init_response import AppInitResponse
|
||||
from ..types.app_modes_response import AppModesResponse
|
||||
|
|
@ -89,7 +89,7 @@ class AppResource(SyncAPIResource):
|
|||
def log(
|
||||
self,
|
||||
*,
|
||||
level: Literal["debug", "info", "error", "warn"],
|
||||
level: LogLevel,
|
||||
message: str,
|
||||
service: str,
|
||||
extra: Dict[str, object] | NotGiven = NOT_GIVEN,
|
||||
|
|
@ -237,7 +237,7 @@ class AsyncAppResource(AsyncAPIResource):
|
|||
async def log(
|
||||
self,
|
||||
*,
|
||||
level: Literal["debug", "info", "error", "warn"],
|
||||
level: LogLevel,
|
||||
message: str,
|
||||
service: str,
|
||||
extra: Dict[str, object] | NotGiven = NOT_GIVEN,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from .message import Message as Message
|
|||
from .session import Session as Session
|
||||
from .provider import Provider as Provider
|
||||
from .file_part import FilePart as FilePart
|
||||
from .log_level import LogLevel as LogLevel
|
||||
from .text_part import TextPart as TextPart
|
||||
from .tool_part import ToolPart as ToolPart
|
||||
from .file_source import FileSource as FileSource
|
||||
|
|
|
|||
|
|
@ -3,13 +3,15 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Dict
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .log_level import LogLevel
|
||||
|
||||
__all__ = ["AppLogParams"]
|
||||
|
||||
|
||||
class AppLogParams(TypedDict, total=False):
|
||||
level: Required[Literal["debug", "info", "error", "warn"]]
|
||||
level: Required[LogLevel]
|
||||
"""Log level"""
|
||||
|
||||
message: Required[str]
|
||||
|
|
|
|||
7
src/opencode_ai/types/log_level.py
Normal file
7
src/opencode_ai/types/log_level.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
__all__ = ["LogLevel"]
|
||||
|
||||
LogLevel: TypeAlias = Literal["debug", "info", "error", "warn"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue