Skip to content

Commit 6633c38

Browse files
docs: add source file links to readme (#247)
1 parent 681a3cb commit 6633c38

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ The SDK defines methods that return response "chunk" streams, where each chunk c
177177

178178
Some of these methods may have streaming and non-streaming variants, but a streaming method will always have a `Streaming` suffix in its name, even if it doesn't have a non-streaming variant.
179179

180-
These streaming methods return `StreamResponse` for synchronous clients:
180+
These streaming methods return [`StreamResponse`](openai-java-core/src/main/kotlin/com/openai/core/http/StreamResponse.kt) for synchronous clients:
181181

182182
```java
183183
import com.openai.core.http.StreamResponse;
@@ -191,7 +191,7 @@ try (StreamResponse<ChatCompletionChunk> streamResponse = client.chat().completi
191191
}
192192
```
193193

194-
Or `AsyncStreamResponse` for asynchronous clients:
194+
Or [`AsyncStreamResponse`](openai-java-core/src/main/kotlin/com/openai/core/http/AsyncStreamResponse.kt) for asynchronous clients:
195195

196196
```java
197197
import com.openai.core.http.AsyncStreamResponse;
@@ -236,7 +236,7 @@ client.async().chat().completions().createStreaming(params)
236236
});
237237
```
238238

239-
Async streaming uses a dedicated per-client cached thread pool `Executor` to stream without blocking the current thread. This default is suitable for most purposes.
239+
Async streaming uses a dedicated per-client cached thread pool [`Executor`](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html) to stream without blocking the current thread. This default is suitable for most purposes.
240240

241241
To use a different `Executor`, configure the subscription using the `executor` parameter:
242242

@@ -267,7 +267,7 @@ OpenAIClient client = OpenAIOkHttpClient.builder()
267267

268268
The SDK defines methods that return binary responses, which are used for API responses that shouldn't necessarily be parsed, like non-JSON data.
269269

270-
These methods return `HttpResponse`:
270+
These methods return [`HttpResponse`](openai-java-core/src/main/kotlin/com/openai/core/http/HttpResponse.kt):
271271

272272
```java
273273
import com.openai.core.http.HttpResponse;
@@ -279,7 +279,7 @@ FileContentParams params = FileContentParams.builder()
279279
HttpResponse response = client.files().content(params);
280280
```
281281

282-
To save the response content to a file, use the `Files.copy(...)` method:
282+
To save the response content to a file, use the [`Files.copy(...)`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#copy-java.io.InputStream-java.nio.file.Path-java.nio.file.CopyOption...-) method:
283283

284284
```java
285285
import com.openai.core.http.HttpResponse;
@@ -299,7 +299,7 @@ try (HttpResponse response = client.files().content(params)) {
299299
}
300300
```
301301

302-
Or transfer the response content to any `OutputStream`:
302+
Or transfer the response content to any [`OutputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html):
303303

304304
```java
305305
import com.openai.core.http.HttpResponse;
@@ -318,7 +318,7 @@ try (HttpResponse response = client.files().content(params)) {
318318

319319
The SDK throws custom unchecked exception types:
320320

321-
- `OpenAIServiceException`: Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:
321+
- [`OpenAIServiceException`](openai-java-core/src/main/kotlin/com/openai/errors/OpenAIServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:
322322

323323
| Status | Exception |
324324
| ------ | ------------------------------- |
@@ -331,11 +331,11 @@ The SDK throws custom unchecked exception types:
331331
| 5xx | `InternalServerException` |
332332
| others | `UnexpectedStatusCodeException` |
333333

334-
- `OpenAIIoException`: I/O networking errors.
334+
- [`OpenAIIoException`](openai-java-core/src/main/kotlin/com/openai/errors/OpenAIIoException.kt): I/O networking errors.
335335

336-
- `OpenAIInvalidDataException`: Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response.
336+
- [`OpenAIInvalidDataException`](openai-java-core/src/main/kotlin/com/openai/errors/OpenAIInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response.
337337

338-
- `OpenAIException`: Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.
338+
- [`OpenAIException`](openai-java-core/src/main/kotlin/com/openai/errors/OpenAIException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.
339339

340340
## Pagination
341341

@@ -520,7 +520,7 @@ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
520520

521521
These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods. You can also set undocumented parameters on nested headers, query params, or body classes using the `putAdditionalProperty` method. These properties can be accessed on the built object later using the `_additionalProperties()` method.
522522

523-
To set a documented parameter or property to an undocumented or not yet supported _value_, pass a `JsonValue` object to its setter:
523+
To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](openai-java-core/src/main/kotlin/com/openai/core/JsonValue.kt) object to its setter:
524524

525525
```java
526526
import com.openai.core.JsonValue;
@@ -591,7 +591,7 @@ if (messages.isMissing()) {
591591

592592
In rare cases, the API may return a response that doesn't match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.
593593

594-
By default, the SDK will not throw an exception in this case. It will throw `OpenAIInvalidDataException` only if you directly access the property.
594+
By default, the SDK will not throw an exception in this case. It will throw [`OpenAIInvalidDataException`](openai-java-core/src/main/kotlin/com/openai/errors/OpenAIInvalidDataException.kt) only if you directly access the property.
595595

596596
If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
597597

0 commit comments

Comments
 (0)