Skip to content

Commit 0c6ab25

Browse files
committed
[ Edit ] updated readme.md
1 parent 31792fa commit 0c6ab25

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ If you don't belong actually to any organization, you can just ignore this secti
144144

145145
</br>
146146

147-
### Settings a default request timeout.
147+
### Settings a default request timeout
148148

149149
The package make use if the [http](https://pub.dev/packages/http) to make requests, this one have a default timeout of 30 seconds, this means that any requests that takes more than 30 seconds will be cancelled, and a exception will be thrown, to chenge that you will need to set your own default timeout:
150150

@@ -162,6 +162,22 @@ You can change the base url used in the package to your own, this can be helpful
162162
OpenAI.baseUrl = "https://api.openai.com/v1"; // the default one.
163163
```
164164

165+
### Enable debugging and logs
166+
You can make the package logs the operations flows and steps by setting the `showLogs`:
167+
168+
```dart
169+
OpenAI.showLogs = true;
170+
```
171+
172+
This will only log the requests steps such when the request started and finished, when the decoding started...
173+
174+
But if you want to log raw responses that are returned from the API (JSON, RAW...), you can set the `showResponsesLogs` to `true`:
175+
176+
```dart
177+
OpenAI.showResponsesLogs = true;
178+
```
179+
180+
This will log the raw responses that are returned from the API, such when the request is successful, or when it failed. (This don't include the stream responses).
165181

166182
## Models
167183

0 commit comments

Comments
 (0)