MCPcopy Create free account

hub / github.com/anomalyco/opencode-sdk-python / functions

Functions901 in github.com/anomalyco/opencode-sdk-python

↓ 214 callersMethodget
Get app info
src/opencode_ai/resources/app.py:51
↓ 157 callersFunctionassert_matches_type
( type_: Any, value: object, *, path: list[str], allow_none: bool = False, )
tests/utils.py:48
↓ 104 callersMethodparse
(self, query: str)
src/opencode_ai/_qs.py:36
↓ 99 callersMethodconstruct
( # pyright: ignore[reportIncompatibleMethodOverride] __cls: Type[ModelT], _fields_set: set[s
src/opencode_ai/_models.py:181
↓ 62 callersFunctionmake_request_options
Create a dict of type RequestOptions without keys of NotGiven values.
src/opencode_ai/_base_client.py:1814
↓ 56 callersFunctiontransform
( data: _T, expected_type: object, use_async: bool, )
tests/test_transform.py:26
↓ 49 callersMethod_build_request
( self, options: FinalRequestOptions, *, retries_taken: int = 0, )
src/opencode_ai/_base_client.py:473
↓ 27 callersFunctionfoo
(a: str | None = None)
tests/test_required_args.py:10
↓ 26 callersFunctionasync_to_raw_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support returning the raw `APIResponse` object directly.
src/opencode_ai/_response.py:754
↓ 26 callersFunctionasync_to_streamed_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support streaming and returning the raw `APIResponse` object directl
src/opencode_ai/_response.py:666
↓ 26 callersFunctionto_raw_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support returning the raw `APIResponse` object directly.
src/opencode_ai/_response.py:737
↓ 26 callersFunctionto_streamed_response_wrapper
Higher order function that takes one of our bound API methods and wraps it to support streaming and returning the raw `APIResponse` object directl
src/opencode_ai/_response.py:647
↓ 25 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/opencode_ai/_client.py:123
↓ 22 callersMethodjson
Read and decode the JSON response content.
src/opencode_ai/_response.py:339
↓ 22 callersMethodlist
Get events
src/opencode_ai/resources/event.py:45
↓ 21 callersFunctionconstruct_type
Loose coercion to the expected type with construction of nested values. If the given value does not match the expected type then it is returned a
src/opencode_ai/_models.py:445
↓ 21 callersFunctionget_args
(t: type[Any])
src/opencode_ai/_compat.py:31
↓ 20 callersMethodpost
( self, path: str, *, cast_to: Type[ResponseT], body: Body | None = No
src/opencode_ai/_base_client.py:1191
↓ 15 callersFunctionget_origin
(t: type[Any])
src/opencode_ai/_compat.py:37
↓ 15 callersFunctioniter_next
(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent])
tests/test_streaming.py:224
↓ 15 callersMethodmodel_dump_json
Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json Generates a JSON representation of the model using
src/opencode_ai/_models.py:310
↓ 14 callersMethodinit
Initialize the app
src/opencode_ai/resources/app.py:70
↓ 14 callersFunctionis_mapping
(obj: object)
src/opencode_ai/_utils/_utils.py:160
↓ 14 callersMethodmodel_dump
Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump Generate a dictionary representation of the model, opti
src/opencode_ai/_models.py:253
↓ 13 callersMethodcopy
Create a new client instance re-using the same options given to the current client with optional overriding.
src/opencode_ai/_client.py:284
↓ 13 callersFunctionextract_type_var_from_base
Given a type like `Foo[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g. ```py
src/opencode_ai/_utils/_typing.py:86
↓ 13 callersFunctionis_given
(obj: NotGivenOr[_T])
src/opencode_ai/_utils/_utils.py:130
↓ 13 callersMethodread
Read and return the binary response content.
src/opencode_ai/_response.py:324
↓ 12 callersFunction_get_params
(client: BaseClient[Any, Any])
tests/test_client.py:43
↓ 12 callersMethoddecode
(self, line: str)
src/opencode_ai/_streaming.py:245
↓ 12 callersMethodto_dict
Recursively generate a dictionary representation of the model, optionally specifying which fields to include or exclude. By default, fields t
src/opencode_ai/_models.py:99
↓ 11 callersFunctionassert_different_identities
(obj1: object, obj2: object)
tests/test_deepcopy.py:4
↓ 11 callersFunctionextract_response_type
Given a type like `APIResponse[T]`, returns the generic type variable `T`. This also handles the case where a concrete subclass is given, e.g.
src/opencode_ai/_response.py:817
↓ 11 callersMethodget
( self, path: str, *, cast_to: Type[ResponseT], options: RequestOption
src/opencode_ai/_base_client.py:1145
↓ 11 callersFunctionis_list
(obj: object)
src/opencode_ai/_utils/_utils.py:172
↓ 11 callersMethodto_json
Generates a JSON string representing this model as it would be received from or sent to the API (but with indentation). By default, fields th
src/opencode_ai/_models.py:137
↓ 10 callersFunctionasync_maybe_transform
Wrapper over `async_transform()` that allows `None` to be passed. See `async_transform()` for more details.
src/opencode_ai/_utils/_transform.py:278
↓ 10 callersFunctionbody
()
tests/test_streaming.py:15
↓ 10 callersMethodchat
Create and send a new message to a session Args: id: Session ID extra_headers: Send extra headers ex
src/opencode_ai/resources/session.py:157
↓ 10 callersMethodis_closed
Whether or not the response body has been closed. If this is False then there is response data that has not been read yet. You must e
src/opencode_ai/_response.py:113
↓ 10 callersFunctionmake_event_iterator
( content: Iterator[bytes], *, sync: bool, client: Opencode, async_client: AsyncOpencode,
tests/test_streaming.py:236
↓ 10 callersFunctionmaybe_transform
Wrapper over `transform()` that allows `None` to be passed. See `transform()` for more details.
src/opencode_ai/_utils/_transform.py:76
↓ 10 callersMethodrevert
Revert a message Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the re
src/opencode_ai/resources/session.py:292
↓ 9 callersFunctionassert_empty_iter
(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent])
tests/test_streaming.py:231
↓ 8 callersMethodabort
Abort a session Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the req
src/opencode_ai/resources/session.py:124
↓ 8 callersMethoddelete
( self, path: str, *, cast_to: Type[ResponseT], body: Body | None = No
src/opencode_ai/_base_client.py:1269
↓ 8 callersFunctionextract_type_arg
(typ: type, index: int)
src/opencode_ai/_utils/_typing.py:78
↓ 8 callersMethodlog
Write a log entry to the server logs Args: level: Log level message: Log message service: Service na
src/opencode_ai/resources/app.py:89
↓ 8 callersMethodmessages
List messages for a session Args: id: Session ID extra_headers: Send extra headers extra_query: Add
src/opencode_ai/resources/session.py:257
↓ 8 callersMethodshare
Share a session Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the req
src/opencode_ai/resources/session.py:334
↓ 8 callersMethodsummarize
Summarize the session Args: id: Session ID extra_headers: Send extra headers extra_query: Add additi
src/opencode_ai/resources/session.py:367
↓ 8 callersMethodunrevert
Restore all reverted messages Args: extra_headers: Send extra headers extra_query: Add additional query paramet
src/opencode_ai/resources/session.py:411
↓ 8 callersMethodunshare
Unshare the session Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the
src/opencode_ai/resources/session.py:444
↓ 7 callersMethodclose
Close the response and release the connection. Automatically called if the response body is read to completion.
src/opencode_ai/_streaming.py:75
↓ 7 callersFunctiondeepcopy_minimal
Minimal reimplementation of copy.deepcopy() that will only copy certain object types: - mappings, e.g. `dict` - list This is done for pe
src/opencode_ai/_utils/_utils.py:180
↓ 7 callersMethodparse
(self, *, to: type[_T])
src/opencode_ai/_response.py:274
↓ 7 callersMethodparse
(self, *, to: type[_T])
src/opencode_ai/_response.py:376
↓ 7 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/opencode_ai/_base_client.py:911
↓ 6 callersMethod__get_proxied__
(self)
src/opencode_ai/_utils/_proxy.py:57
↓ 6 callersMethodappend_prompt
Append prompt to the TUI Args: extra_headers: Send extra headers extra_query: Add additional query parameters t
src/opencode_ai/resources/tui.py:45
↓ 6 callersMethodcreate
Create a new session
src/opencode_ai/resources/session.py:53
↓ 6 callersFunctionextract_files
Recursively extract files from the given dictionary based on specified paths. A path may look like this ['foo', 'files', '<array>', 'data'].
src/opencode_ai/_utils/_utils.py:38
↓ 6 callersMethodfiles
Find files Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request
src/opencode_ai/resources/find.py:46
↓ 6 callersFunctionmodel_dump
( model: pydantic.BaseModel, *, exclude: IncEx | None = None, exclude_unset: bool = False,
src/opencode_ai/_compat.py:133
↓ 6 callersMethodmodes
List all modes
src/opencode_ai/resources/app.py:140
↓ 6 callersMethodopen_help
Open the help dialog
src/opencode_ai/resources/tui.py:77
↓ 6 callersMethodproviders
List all providers
src/opencode_ai/resources/app.py:159
↓ 6 callersMethodstatus
Get file status
src/opencode_ai/resources/file.py:80
↓ 6 callersMethodsymbols
Find workspace symbols Args: extra_headers: Send extra headers extra_query: Add additional query parameters to
src/opencode_ai/resources/find.py:81
↓ 6 callersMethodtext
Read and decode the response content into a string.
src/opencode_ai/_response.py:334
↓ 5 callersMethod__init__
( self, *, url: URL, )
src/opencode_ai/_base_client.py:125
↓ 5 callersFunctionasync_to_httpx_files
(files: None)
src/opencode_ai/_files.py:84
↓ 5 callersFunctionis_annotated_type
(typ: type)
src/opencode_ai/_utils/_typing.py:21
↓ 5 callersFunctionis_dict
(obj: object)
src/opencode_ai/_utils/_utils.py:168
↓ 5 callersFunctionmodel_copy
(model: _ModelT, *, deep: bool = False)
src/opencode_ai/_compat.py:121
↓ 5 callersMethodrequest
( self, cast_to: Type[ResponseT], options: FinalRequestOptions, *, str
src/opencode_ai/_base_client.py:1438
↓ 5 callersFunctionto_httpx_files
(files: None)
src/opencode_ai/_files.py:42
↓ 4 callersMethod__init__
(self, message: str, request: httpx.Request, *, body: object | None)
src/opencode_ai/_exceptions.py:40
↓ 4 callersMethod_calculate_retry_timeout
( self, remaining_retries: int, options: FinalRequestOptions, response_headers
src/opencode_ai/_base_client.py:724
↓ 4 callersFunction_get_open_connections
(client: Opencode | AsyncOpencode)
tests/test_client.py:53
↓ 4 callersMethoditer_bytes
A byte-iterator over the decoded response content. This automatically handles gzip, deflate and brotli encoded responses.
src/opencode_ai/_response.py:351
↓ 4 callersFunctionparse_obj
(model: type[_ModelT], value: object)
src/opencode_ai/_compat.py:79
↓ 3 callersFunction_get_annotated_type
If the given type is an `Annotated` type then it is returned, if not `None` is returned. This also unwraps the type when applicable, e.g. `Requir
src/opencode_ai/_utils/_transform.py:114
↓ 3 callersMethod_get_page_items
(self)
src/opencode_ai/_base_client.py:188
↓ 3 callersMethod_iter_events
(self)
src/opencode_ai/_streaming.py:48
↓ 3 callersFunction_merge_mappings
Merge two mappings of the same type, removing any values that are instances of `Omit`. In cases with duplicate keys the second mapping takes prec
src/opencode_ai/_base_client.py:1986
↓ 3 callersMethod_request_api_list
( self, model: Type[object], page: Type[SyncPageT], options: FinalRequestOptio
src/opencode_ai/_base_client.py:1126
↓ 3 callersMethod_sleep_for_retry
( self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Respons
src/opencode_ai/_base_client.py:1058
↓ 3 callersMethod_sleep_for_retry
( self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Respons
src/opencode_ai/_base_client.py:1590
↓ 3 callersFunction_transform_recursive
Transform the given data against the expected type. Args: annotation: The direct type annotation given to the particular piece of data.
src/opencode_ai/_utils/_transform.py:152
↓ 3 callersMethodaiter_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/opencode_ai/_streaming.py:223
↓ 3 callersMethodclose
Close the underlying HTTPX client. The client will *not* be usable after this.
src/opencode_ai/_base_client.py:871
↓ 3 callersMethodget_max_retries
(self, max_retries: int)
src/opencode_ai/_models.py:792
↓ 3 callersFunctionhuman_join
(seq: Sequence[str], *, delim: str = ", ", final: str = "or")
src/opencode_ai/_utils/_utils.py:196
↓ 3 callersFunctionis_file_content
(obj: object)
src/opencode_ai/_files.py:27
↓ 3 callersFunctionis_iterable
(obj: object)
src/opencode_ai/_utils/_utils.py:176
↓ 3 callersFunctionis_list_type
(typ: type)
src/opencode_ai/_utils/_typing.py:25
↓ 3 callersFunctionis_mapping_t
(obj: _MappingT | object)
src/opencode_ai/_utils/_utils.py:164
↓ 3 callersFunctionis_type_alias_type
Return whether the provided argument is an instance of `TypeAliasType`. ```python type Int = int is_type_alias_type(Int) # > True
src/opencode_ai/_utils/_typing.py:54
↓ 3 callersFunctionis_union_type
(typ: type)
src/opencode_ai/_utils/_typing.py:35
next →1–100 of 901, ranked by callers