feat(api): update via SDK Studio

This commit is contained in:
stainless-app[bot] 2025-07-02 10:58:33 +00:00
parent 3afcacf5f9
commit ce2269062c
20 changed files with 925 additions and 60 deletions

View file

@ -21,7 +21,7 @@ from ._types import (
)
from ._utils import is_given, get_async_library
from ._version import __version__
from .resources import app, file, event, config, session
from .resources import app, file, find, event, config, session
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError
from ._base_client import (
@ -45,6 +45,7 @@ __all__ = [
class Opencode(SyncAPIClient):
event: event.EventResource
app: app.AppResource
find: find.FindResource
file: file.FileResource
config: config.ConfigResource
session: session.SessionResource
@ -96,6 +97,7 @@ class Opencode(SyncAPIClient):
self.event = event.EventResource(self)
self.app = app.AppResource(self)
self.find = find.FindResource(self)
self.file = file.FileResource(self)
self.config = config.ConfigResource(self)
self.session = session.SessionResource(self)
@ -202,6 +204,7 @@ class Opencode(SyncAPIClient):
class AsyncOpencode(AsyncAPIClient):
event: event.AsyncEventResource
app: app.AsyncAppResource
find: find.AsyncFindResource
file: file.AsyncFileResource
config: config.AsyncConfigResource
session: session.AsyncSessionResource
@ -253,6 +256,7 @@ class AsyncOpencode(AsyncAPIClient):
self.event = event.AsyncEventResource(self)
self.app = app.AsyncAppResource(self)
self.find = find.AsyncFindResource(self)
self.file = file.AsyncFileResource(self)
self.config = config.AsyncConfigResource(self)
self.session = session.AsyncSessionResource(self)
@ -360,6 +364,7 @@ class OpencodeWithRawResponse:
def __init__(self, client: Opencode) -> None:
self.event = event.EventResourceWithRawResponse(client.event)
self.app = app.AppResourceWithRawResponse(client.app)
self.find = find.FindResourceWithRawResponse(client.find)
self.file = file.FileResourceWithRawResponse(client.file)
self.config = config.ConfigResourceWithRawResponse(client.config)
self.session = session.SessionResourceWithRawResponse(client.session)
@ -369,6 +374,7 @@ class AsyncOpencodeWithRawResponse:
def __init__(self, client: AsyncOpencode) -> None:
self.event = event.AsyncEventResourceWithRawResponse(client.event)
self.app = app.AsyncAppResourceWithRawResponse(client.app)
self.find = find.AsyncFindResourceWithRawResponse(client.find)
self.file = file.AsyncFileResourceWithRawResponse(client.file)
self.config = config.AsyncConfigResourceWithRawResponse(client.config)
self.session = session.AsyncSessionResourceWithRawResponse(client.session)
@ -378,6 +384,7 @@ class OpencodeWithStreamedResponse:
def __init__(self, client: Opencode) -> None:
self.event = event.EventResourceWithStreamingResponse(client.event)
self.app = app.AppResourceWithStreamingResponse(client.app)
self.find = find.FindResourceWithStreamingResponse(client.find)
self.file = file.FileResourceWithStreamingResponse(client.file)
self.config = config.ConfigResourceWithStreamingResponse(client.config)
self.session = session.SessionResourceWithStreamingResponse(client.session)
@ -387,6 +394,7 @@ class AsyncOpencodeWithStreamedResponse:
def __init__(self, client: AsyncOpencode) -> None:
self.event = event.AsyncEventResourceWithStreamingResponse(client.event)
self.app = app.AsyncAppResourceWithStreamingResponse(client.app)
self.find = find.AsyncFindResourceWithStreamingResponse(client.find)
self.file = file.AsyncFileResourceWithStreamingResponse(client.file)
self.config = config.AsyncConfigResourceWithStreamingResponse(client.config)
self.session = session.AsyncSessionResourceWithStreamingResponse(client.session)

View file

@ -16,6 +16,14 @@ from .file import (
FileResourceWithStreamingResponse,
AsyncFileResourceWithStreamingResponse,
)
from .find import (
FindResource,
AsyncFindResource,
FindResourceWithRawResponse,
AsyncFindResourceWithRawResponse,
FindResourceWithStreamingResponse,
AsyncFindResourceWithStreamingResponse,
)
from .event import (
EventResource,
AsyncEventResource,
@ -54,6 +62,12 @@ __all__ = [
"AsyncAppResourceWithRawResponse",
"AppResourceWithStreamingResponse",
"AsyncAppResourceWithStreamingResponse",
"FindResource",
"AsyncFindResource",
"FindResourceWithRawResponse",
"AsyncFindResourceWithRawResponse",
"FindResourceWithStreamingResponse",
"AsyncFindResourceWithStreamingResponse",
"FileResource",
"AsyncFileResource",
"FileResourceWithRawResponse",

View file

@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..types import file_search_params
from ..types import file_read_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
@ -16,7 +16,8 @@ from .._response import (
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.file_search_response import FileSearchResponse
from ..types.file_read_response import FileReadResponse
from ..types.file_status_response import FileStatusResponse
__all__ = ["FileResource", "AsyncFileResource"]
@ -41,19 +42,19 @@ class FileResource(SyncAPIResource):
"""
return FileResourceWithStreamingResponse(self)
def search(
def read(
self,
*,
query: str,
path: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileSearchResponse:
) -> FileReadResponse:
"""
Search for files
Read a file
Args:
extra_headers: Send extra headers
@ -71,9 +72,28 @@ class FileResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"query": query}, file_search_params.FileSearchParams),
query=maybe_transform({"path": path}, file_read_params.FileReadParams),
),
cast_to=FileSearchResponse,
cast_to=FileReadResponse,
)
def status(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileStatusResponse:
"""Get file status"""
return self._get(
"/file/status",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=FileStatusResponse,
)
@ -97,19 +117,19 @@ class AsyncFileResource(AsyncAPIResource):
"""
return AsyncFileResourceWithStreamingResponse(self)
async def search(
async def read(
self,
*,
query: str,
path: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileSearchResponse:
) -> FileReadResponse:
"""
Search for files
Read a file
Args:
extra_headers: Send extra headers
@ -127,9 +147,28 @@ class AsyncFileResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"query": query}, file_search_params.FileSearchParams),
query=await async_maybe_transform({"path": path}, file_read_params.FileReadParams),
),
cast_to=FileSearchResponse,
cast_to=FileReadResponse,
)
async def status(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FileStatusResponse:
"""Get file status"""
return await self._get(
"/file/status",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=FileStatusResponse,
)
@ -137,8 +176,11 @@ class FileResourceWithRawResponse:
def __init__(self, file: FileResource) -> None:
self._file = file
self.search = to_raw_response_wrapper(
file.search,
self.read = to_raw_response_wrapper(
file.read,
)
self.status = to_raw_response_wrapper(
file.status,
)
@ -146,8 +188,11 @@ class AsyncFileResourceWithRawResponse:
def __init__(self, file: AsyncFileResource) -> None:
self._file = file
self.search = async_to_raw_response_wrapper(
file.search,
self.read = async_to_raw_response_wrapper(
file.read,
)
self.status = async_to_raw_response_wrapper(
file.status,
)
@ -155,8 +200,11 @@ class FileResourceWithStreamingResponse:
def __init__(self, file: FileResource) -> None:
self._file = file
self.search = to_streamed_response_wrapper(
file.search,
self.read = to_streamed_response_wrapper(
file.read,
)
self.status = to_streamed_response_wrapper(
file.status,
)
@ -164,6 +212,9 @@ class AsyncFileResourceWithStreamingResponse:
def __init__(self, file: AsyncFileResource) -> None:
self._file = file
self.search = async_to_streamed_response_wrapper(
file.search,
self.read = async_to_streamed_response_wrapper(
file.read,
)
self.status = async_to_streamed_response_wrapper(
file.status,
)

View file

@ -0,0 +1,335 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
import httpx
from ..types import find_text_params, find_files_params, find_symbols_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.find_text_response import FindTextResponse
from ..types.find_files_response import FindFilesResponse
from ..types.find_symbols_response import FindSymbolsResponse
__all__ = ["FindResource", "AsyncFindResource"]
class FindResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> FindResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return FindResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> FindResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return FindResourceWithStreamingResponse(self)
def files(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindFilesResponse:
"""
Find files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/find/file",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"query": query}, find_files_params.FindFilesParams),
),
cast_to=FindFilesResponse,
)
def symbols(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindSymbolsResponse:
"""
Find workspace symbols
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/find/symbol",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"query": query}, find_symbols_params.FindSymbolsParams),
),
cast_to=FindSymbolsResponse,
)
def text(
self,
*,
pattern: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindTextResponse:
"""
Find text in files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/find",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"pattern": pattern}, find_text_params.FindTextParams),
),
cast_to=FindTextResponse,
)
class AsyncFindResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncFindResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncFindResourceWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> AsyncFindResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
"""
return AsyncFindResourceWithStreamingResponse(self)
async def files(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindFilesResponse:
"""
Find files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/find/file",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"query": query}, find_files_params.FindFilesParams),
),
cast_to=FindFilesResponse,
)
async def symbols(
self,
*,
query: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindSymbolsResponse:
"""
Find workspace symbols
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/find/symbol",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"query": query}, find_symbols_params.FindSymbolsParams),
),
cast_to=FindSymbolsResponse,
)
async def text(
self,
*,
pattern: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> FindTextResponse:
"""
Find text in files
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/find",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"pattern": pattern}, find_text_params.FindTextParams),
),
cast_to=FindTextResponse,
)
class FindResourceWithRawResponse:
def __init__(self, find: FindResource) -> None:
self._find = find
self.files = to_raw_response_wrapper(
find.files,
)
self.symbols = to_raw_response_wrapper(
find.symbols,
)
self.text = to_raw_response_wrapper(
find.text,
)
class AsyncFindResourceWithRawResponse:
def __init__(self, find: AsyncFindResource) -> None:
self._find = find
self.files = async_to_raw_response_wrapper(
find.files,
)
self.symbols = async_to_raw_response_wrapper(
find.symbols,
)
self.text = async_to_raw_response_wrapper(
find.text,
)
class FindResourceWithStreamingResponse:
def __init__(self, find: FindResource) -> None:
self._find = find
self.files = to_streamed_response_wrapper(
find.files,
)
self.symbols = to_streamed_response_wrapper(
find.symbols,
)
self.text = to_streamed_response_wrapper(
find.text,
)
class AsyncFindResourceWithStreamingResponse:
def __init__(self, find: AsyncFindResource) -> None:
self._find = find
self.files = async_to_streamed_response_wrapper(
find.files,
)
self.symbols = async_to_streamed_response_wrapper(
find.symbols,
)
self.text = async_to_streamed_response_wrapper(
find.text,
)

View file

@ -23,17 +23,24 @@ from .source_url_part import SourceURLPart as SourceURLPart
from .step_start_part import StepStartPart as StepStartPart
from .text_part_param import TextPartParam as TextPartParam
from .tool_call_param import ToolCallParam as ToolCallParam
from .file_read_params import FileReadParams as FileReadParams
from .find_text_params import FindTextParams as FindTextParams
from .app_init_response import AppInitResponse as AppInitResponse
from .find_files_params import FindFilesParams as FindFilesParams
from .tool_partial_call import ToolPartialCall as ToolPartialCall
from .tool_result_param import ToolResultParam as ToolResultParam
from .file_search_params import FileSearchParams as FileSearchParams
from .file_read_response import FileReadResponse as FileReadResponse
from .find_text_response import FindTextResponse as FindTextResponse
from .message_part_param import MessagePartParam as MessagePartParam
from .event_list_response import EventListResponse as EventListResponse
from .find_files_response import FindFilesResponse as FindFilesResponse
from .find_symbols_params import FindSymbolsParams as FindSymbolsParams
from .session_chat_params import SessionChatParams as SessionChatParams
from .session_init_params import SessionInitParams as SessionInitParams
from .file_search_response import FileSearchResponse as FileSearchResponse
from .file_status_response import FileStatusResponse as FileStatusResponse
from .reasoning_part_param import ReasoningPartParam as ReasoningPartParam
from .tool_invocation_part import ToolInvocationPart as ToolInvocationPart
from .find_symbols_response import FindSymbolsResponse as FindSymbolsResponse
from .session_init_response import SessionInitResponse as SessionInitResponse
from .session_list_response import SessionListResponse as SessionListResponse
from .source_url_part_param import SourceURLPartParam as SourceURLPartParam

View file

@ -40,6 +40,8 @@ __all__ = [
"EventSessionErrorProperties",
"EventSessionErrorPropertiesError",
"EventSessionErrorPropertiesErrorMessageOutputLengthError",
"EventFileWatcherUpdated",
"EventFileWatcherUpdatedProperties",
]
@ -185,6 +187,18 @@ class EventSessionError(BaseModel):
type: Literal["session.error"]
class EventFileWatcherUpdatedProperties(BaseModel):
event: Literal["rename", "change"]
file: str
class EventFileWatcherUpdated(BaseModel):
properties: EventFileWatcherUpdatedProperties
type: Literal["file.watcher.updated"]
EventListResponse: TypeAlias = Annotated[
Union[
EventLspClientDiagnostics,
@ -198,6 +212,7 @@ EventListResponse: TypeAlias = Annotated[
EventSessionDeleted,
EventSessionIdle,
EventSessionError,
EventFileWatcherUpdated,
],
PropertyInfo(discriminator="type"),
]

View file

@ -0,0 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Required, TypedDict
__all__ = ["FileReadParams"]
class FileReadParams(TypedDict, total=False):
path: Required[str]

View file

@ -0,0 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing_extensions import Literal
from .._models import BaseModel
__all__ = ["FileReadResponse"]
class FileReadResponse(BaseModel):
content: str
type: Literal["raw", "patch"]

View file

@ -0,0 +1,21 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing_extensions import Literal, TypeAlias
from .._models import BaseModel
__all__ = ["FileStatusResponse", "FileStatusResponseItem"]
class FileStatusResponseItem(BaseModel):
added: float
file: str
removed: float
status: Literal["added", "deleted", "modified"]
FileStatusResponse: TypeAlias = List[FileStatusResponseItem]

View file

@ -4,8 +4,8 @@ from __future__ import annotations
from typing_extensions import Required, TypedDict
__all__ = ["FileSearchParams"]
__all__ = ["FindFilesParams"]
class FileSearchParams(TypedDict, total=False):
class FindFilesParams(TypedDict, total=False):
query: Required[str]

View file

@ -3,6 +3,6 @@
from typing import List
from typing_extensions import TypeAlias
__all__ = ["FileSearchResponse"]
__all__ = ["FindFilesResponse"]
FileSearchResponse: TypeAlias = List[str]
FindFilesResponse: TypeAlias = List[str]

View file

@ -0,0 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Required, TypedDict
__all__ = ["FindSymbolsParams"]
class FindSymbolsParams(TypedDict, total=False):
query: Required[str]

View file

@ -0,0 +1,8 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing_extensions import TypeAlias
__all__ = ["FindSymbolsResponse"]
FindSymbolsResponse: TypeAlias = List[object]

View file

@ -0,0 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Required, TypedDict
__all__ = ["FindTextParams"]
class FindTextParams(TypedDict, total=False):
pattern: Required[str]

View file

@ -0,0 +1,50 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing_extensions import TypeAlias
from .._models import BaseModel
__all__ = [
"FindTextResponse",
"FindTextResponseItem",
"FindTextResponseItemLines",
"FindTextResponseItemPath",
"FindTextResponseItemSubmatch",
"FindTextResponseItemSubmatchMatch",
]
class FindTextResponseItemLines(BaseModel):
text: str
class FindTextResponseItemPath(BaseModel):
text: str
class FindTextResponseItemSubmatchMatch(BaseModel):
text: str
class FindTextResponseItemSubmatch(BaseModel):
end: float
match: FindTextResponseItemSubmatchMatch
start: float
class FindTextResponseItem(BaseModel):
absolute_offset: float
line_number: float
lines: FindTextResponseItemLines
path: FindTextResponseItemPath
submatches: List[FindTextResponseItemSubmatch]
FindTextResponse: TypeAlias = List[FindTextResponseItem]

View file

@ -23,6 +23,7 @@ __all__ = [
"MetadataAssistantTokensCache",
"MetadataError",
"MetadataErrorMessageOutputLengthError",
"MetadataUser",
]
@ -99,6 +100,10 @@ MetadataError: TypeAlias = Annotated[
]
class MetadataUser(BaseModel):
snapshot: Optional[str] = None
class Metadata(BaseModel):
session_id: str = FieldInfo(alias="sessionID")
@ -110,6 +115,8 @@ class Metadata(BaseModel):
error: Optional[MetadataError] = None
user: Optional[MetadataUser] = None
class Message(BaseModel):
id: str