mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-04-30 21:50:20 +00:00
feat(api): update via SDK Studio
This commit is contained in:
parent
ddb79fc19d
commit
a6cf7c5b2a
109 changed files with 159 additions and 153 deletions
|
|
@ -6,8 +6,8 @@ import httpx
|
|||
import pytest
|
||||
import pydantic
|
||||
|
||||
from opencode import Opencode, BaseModel, AsyncOpencode
|
||||
from opencode._response import (
|
||||
from opencode_ai import Opencode, BaseModel, AsyncOpencode
|
||||
from opencode_ai._response import (
|
||||
APIResponse,
|
||||
BaseAPIResponse,
|
||||
AsyncAPIResponse,
|
||||
|
|
@ -15,8 +15,8 @@ from opencode._response import (
|
|||
AsyncBinaryAPIResponse,
|
||||
extract_response_type,
|
||||
)
|
||||
from opencode._streaming import Stream
|
||||
from opencode._base_client import FinalRequestOptions
|
||||
from opencode_ai._streaming import Stream
|
||||
from opencode_ai._base_client import FinalRequestOptions
|
||||
|
||||
|
||||
class ConcreteBaseAPIResponse(APIResponse[bytes]): ...
|
||||
|
|
@ -37,7 +37,7 @@ def test_extract_response_type_direct_classes() -> None:
|
|||
def test_extract_response_type_direct_class_missing_type_arg() -> None:
|
||||
with pytest.raises(
|
||||
RuntimeError,
|
||||
match="Expected type <class 'opencode._response.AsyncAPIResponse'> to have a type argument at index 0 but it did not",
|
||||
match="Expected type <class 'opencode_ai._response.AsyncAPIResponse'> to have a type argument at index 0 but it did not",
|
||||
):
|
||||
extract_response_type(AsyncAPIResponse)
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ def test_response_parse_mismatched_basemodel(client: Opencode) -> None:
|
|||
|
||||
with pytest.raises(
|
||||
TypeError,
|
||||
match="Pydantic models must subclass our base model type, e.g. `from opencode import BaseModel`",
|
||||
match="Pydantic models must subclass our base model type, e.g. `from opencode_ai import BaseModel`",
|
||||
):
|
||||
response.parse(to=PydanticModel)
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ async def test_async_response_parse_mismatched_basemodel(async_client: AsyncOpen
|
|||
|
||||
with pytest.raises(
|
||||
TypeError,
|
||||
match="Pydantic models must subclass our base model type, e.g. `from opencode import BaseModel`",
|
||||
match="Pydantic models must subclass our base model type, e.g. `from opencode_ai import BaseModel`",
|
||||
):
|
||||
await response.parse(to=PydanticModel)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue