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

Class AsyncFileResource

src/opencode_ai/resources/file.py:100–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99
100class AsyncFileResource(AsyncAPIResource):
101 @cached_property
102 def with_raw_response(self) -> AsyncFileResourceWithRawResponse:
103 """
104 This property can be used as a prefix for any HTTP method call to return
105 the raw response object instead of the parsed content.
106
107 For more information, see https://www.github.com/sst/opencode-sdk-python#accessing-raw-response-data-eg-headers
108 """
109 return AsyncFileResourceWithRawResponse(self)
110
111 @cached_property
112 def with_streaming_response(self) -> AsyncFileResourceWithStreamingResponse:
113 """
114 An alternative to `.with_raw_response` that doesn't eagerly read the response body.
115
116 For more information, see https://www.github.com/sst/opencode-sdk-python#with_streaming_response
117 """
118 return AsyncFileResourceWithStreamingResponse(self)
119
120 async def read(
121 self,
122 *,
123 path: str,
124 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
125 # The extra values given here take precedence over values defined on the client or passed to this method.
126 extra_headers: Headers | None = None,
127 extra_query: Query | None = None,
128 extra_body: Body | None = None,
129 timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
130 ) -> FileReadResponse:
131 """
132 Read a file
133
134 Args:
135 extra_headers: Send extra headers
136
137 extra_query: Add additional query parameters to the request
138
139 extra_body: Add additional JSON properties to the request
140
141 timeout: Override the client-level default timeout for this request, in seconds
142 """
143 return await self._get(
144 "/file",
145 options=make_request_options(
146 extra_headers=extra_headers,
147 extra_query=extra_query,
148 extra_body=extra_body,
149 timeout=timeout,
150 query=await async_maybe_transform({"path": path}, file_read_params.FileReadParams),
151 ),
152 cast_to=FileReadResponse,
153 )
154
155 async def status(
156 self,
157 *,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected