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

Method read

src/opencode_ai/resources/file.py:45–78  ·  view source on GitHub ↗

Read a file 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,

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

Source from the content-addressed store, hash-verified

43 return FileResourceWithStreamingResponse(self)
44
45 def read(
46 self,
47 *,
48 path: str,
49 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
50 # The extra values given here take precedence over values defined on the client or passed to this method.
51 extra_headers: Headers | None = None,
52 extra_query: Query | None = None,
53 extra_body: Body | None = None,
54 timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
55 ) -> FileReadResponse:
56 """
57 Read a file
58
59 Args:
60 extra_headers: Send extra headers
61
62 extra_query: Add additional query parameters to the request
63
64 extra_body: Add additional JSON properties to the request
65
66 timeout: Override the client-level default timeout for this request, in seconds
67 """
68 return self._get(
69 "/file",
70 options=make_request_options(
71 extra_headers=extra_headers,
72 extra_query=extra_query,
73 extra_body=extra_body,
74 timeout=timeout,
75 query=maybe_transform({"path": path}, file_read_params.FileReadParams),
76 ),
77 cast_to=FileReadResponse,
78 )
79
80 def status(
81 self,

Callers 2

_format_dataFunction · 0.45
_async_format_dataFunction · 0.45

Calls 2

make_request_optionsFunction · 0.85
maybe_transformFunction · 0.85

Tested by

no test coverage detected