MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / abort

Method abort

src/opencode_ai/resources/session.py:124–155  ·  view source on GitHub ↗

Abort a session 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 reque

(
        self,
        id: 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,
    )

Source from the content-addressed store, hash-verified

122 )
123
124 def abort(
125 self,
126 id: str,
127 *,
128 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
129 # The extra values given here take precedence over values defined on the client or passed to this method.
130 extra_headers: Headers | None = None,
131 extra_query: Query | None = None,
132 extra_body: Body | None = None,
133 timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
134 ) -> SessionAbortResponse:
135 """
136 Abort a session
137
138 Args:
139 extra_headers: Send extra headers
140
141 extra_query: Add additional query parameters to the request
142
143 extra_body: Add additional JSON properties to the request
144
145 timeout: Override the client-level default timeout for this request, in seconds
146 """
147 if not id:
148 raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
149 return self._post(
150 f"/session/{id}/abort",
151 options=make_request_options(
152 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
153 ),
154 cast_to=SessionAbortResponse,
155 )
156
157 def chat(
158 self,

Calls 1

make_request_optionsFunction · 0.85

Tested by 8

test_method_abortMethod · 0.36
test_method_abortMethod · 0.36