Skip to content

Commit c3f871e

Browse files
committed
Update documents for ver0.6.0
1 parent 19019d9 commit c3f871e

File tree

5 files changed

+45
-38
lines changed

5 files changed

+45
-38
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{
22
"name": "com.mochineko.chatgpt-api.relent",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"displayName": "ChatGPT API / Relent",
55
"description": "ChatGPT API implementation by Relent.",
66
"unity": "2021.3",
77
"author": {
88
"name": "Mochineko",
99
"email": "[email protected]"
10+
},
11+
"dependencies": {
12+
"com.mochineko.chatgpt-api": "https://github.com/mochi-neko/ChatGPT-API-unity.git?path=/Assets/Mochineko/ChatGPT_API#0.6.0",
13+
"com.mochineko.relent": "https://github.com/mochi-neko/Relent.git?path=/Assets/Mochineko/Relent#0.2.0",
14+
"com.unity.nuget.newtonsoft-json": "3.0.2",
15+
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask"
1016
}
1117
}
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
22
"name": "com.mochineko.chatgpt-api",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"displayName": "ChatGPT API",
55
"description": "ChatGPT chat completion API bindings to pure C#.",
66
"unity": "2021.3",
77
"author": {
88
"name": "Mochineko",
99
"email": "[email protected]"
10+
},
11+
"dependencies": {
12+
"com.unity.nuget.newtonsoft-json": "3.0.2"
1013
}
1114
}

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add [moderation layer](https://platform.openai.com/docs/guides/chat/adding-a-moderation-layer)
1313

14+
## [0.6.0] - 2023-06-14
15+
16+
### Added
17+
18+
- Add 16k context turbo model option.
19+
- Add function calling support.
20+
- Add optional `name` property to `Message`.
21+
- Add verbose log option.
22+
23+
## Changed
24+
25+
- Update chat models at 2023-06-13.
26+
- Add dependencies to `package.json`.
27+
1428
## [0.5.0] - 2023-04-08
1529

1630
### Changed

NOTICE.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NOTICE
22

3-
This repository use these 3rd party libraries via UnityPackageManager.
3+
This repository uses these 3rd party libraries.
44

55
## NewtonSoft Json
66

@@ -41,7 +41,6 @@ Unity Technologies ApS (“Unity”) grants to you a worldwide, non-exclusive, n
4141
10. Governing Law and Venue. This License is governed by and construed in accordance with the laws of Denmark, except for its conflict of laws rules; the United Nations Convention on Contracts for the International Sale of Goods will not apply. If you reside (or your principal place of business is) within the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the state and federal courts located in San Francisco County, California concerning any dispute arising out of this License (“Dispute”). If you reside (or your principal place of business is) outside the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the courts located in Copenhagen, Denmark concerning any Dispute.
4242
```
4343

44-
4544
https://www.newtonsoft.com/json
4645

4746
```
@@ -67,7 +66,6 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
6766
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6867
```
6968

70-
7169
## Fluent Assertions for Unity
7270

7371
https://github.com/BoundfoxStudios/fluentassertions-unity
@@ -276,7 +274,6 @@ https://github.com/BoundfoxStudios/fluentassertions-unity
276274
limitations under the License.
277275
```
278276

279-
280277
## UniTask
281278

282279
https://github.com/Cysharp/UniTask
@@ -335,7 +332,6 @@ SOFTWARE.
335332
336333
```
337334

338-
339335
## Relent
340336

341337
https://github.com/mochi-neko/Relent

README.md

+19-31
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
# ChatGPT-API-unity
22

3-
Binds [ChatGPT chat completion API](https://platform.openai.com/docs/api-reference/chat/create) to pure C# on Unity.
3+
A client library of [ChatGPT chat completion API](https://platform.openai.com/docs/api-reference/chat/create) for Unity.
44

5-
See also [official document](https://platform.openai.com/docs/guides/chat).
5+
See also official [document](https://platform.openai.com/docs/guides/chat) and [API reference](https://platform.openai.com/docs/api-reference/chat).
66

7-
## How to import by UnityPackageManager
7+
## How to import by Unity Package Manager
88

9-
Add dependencies:
9+
Add following dependencies to your `/Packages/mainfest.json`.
1010

1111
```json
1212
{
1313
"dependencies": {
14-
"com.mochineko.chatgpt-api": "https://github.com/mochi-neko/ChatGPT-API-unity.git?path=/Assets/Mochineko/ChatGPT_API#0.5.0",
15-
"com.unity.nuget.newtonsoft-json": "3.0.2",
14+
"com.mochineko.chatgpt-api": "https://github.com/mochi-neko/ChatGPT-API-unity.git?path=/Assets/Mochineko/ChatGPT_API#0.6.0",
1615
...
1716
}
1817
}
1918
```
2019

21-
to your `mainfest.json`.
22-
23-
If you have already used Newtonsoft.Json on your project, remove dependency:`"com.unity.nuget.newtonsoft-json": "3.0.2",`.
24-
2520
## How to use chat completion by ChatGPT API
2621

2722
1. Generate API key on [OpenAI](https://platform.openai.com/account/api-keys). (Take care your API key, this is a secret information then you should not open.)
@@ -142,20 +137,7 @@ namespace Mochineko.ChatGPT_API.Samples
142137
}
143138
```
144139

145-
NOTICE that this sample requres these dependencies:
146-
147-
```json
148-
{
149-
"dependencies": {
150-
"com.mochineko.chatgpt-api": "https://github.com/mochi-neko/ChatGPT-API-unity.git?path=/Assets/Mochineko/ChatGPT_API#0.5.0",
151-
"com.unity.nuget.newtonsoft-json": "3.0.2",
152-
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
153-
...
154-
}
155-
}
156-
```
157-
158-
See also [Sample](https://github.com/mochi-neko/ChatGPT-API-unity/blob/main/Assets/Mochineko/ChatGPT_API.Samples/ChatCompletionSample.cs).
140+
See also [Sample](./Assets/Mochineko/ChatGPT_API.Samples/ChatCompletionSample.cs).
159141

160142
## How to use chat completion by ChatGPT API more resilient
161143

@@ -167,10 +149,7 @@ You can use API with explicit error handling, retry, timeout, bulkhead, and so o
167149
```json
168150
{
169151
"dependencies": {
170-
"com.mochineko.chatgpt-api": "https://github.com/mochi-neko/ChatGPT-API-unity.git?path=/Assets/Mochineko/ChatGPT_API#0.5.0",
171-
"com.mochineko.chatgpt-api.relent": "https://github.com/mochi-neko/ChatGPT-API-unity.git?path=/Assets/Mochineko/ChatGPT_API.Relent#0.5.0",
172-
"com.unity.nuget.newtonsoft-json": "3.0.2",
173-
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
152+
"com.mochineko.chatgpt-api.relent": "https://github.com/mochi-neko/ChatGPT-API-unity.git?path=/Assets/Mochineko/ChatGPT_API.Relent#0.6.0",
174153
...
175154
}
176155
}
@@ -216,14 +195,23 @@ Presets are available:
216195
- `FiniteTokenLengthQueueWithFixedPromptsChatMemory`
217196
- A queue that has max number of token lenght of user/assistant messages and free number of prompts (system messages).
218197

198+
## How to use function calling
199+
200+
1. Define function with JSON schema.
201+
2. Specify function by request parameters.
202+
3. Call chat completion API.
203+
4. Use `result.Choices[0].Message.FunctionCall`
204+
205+
See `FunctionCalling()` in [test code](./Assets/Mochineko/ChatGPT_API.Tests/ChatCompletionAPIConnectionTest.cs).
206+
219207
## Changelog
220208

221-
See [CHANGELOG](https://github.com/mochi-neko/ChatGPT-API-unity/blob/main/CHANGELOG.md).
209+
See [CHANGELOG](./CHANGELOG.md).
222210

223211
## 3rd Party Notices
224212

225-
See [NOTICE](https://github.com/mochi-neko/ChatGPT-API-unity/blob/main/NOTICE.md).
213+
See [NOTICE](./NOTICE.md).
226214

227215
## License
228216

229-
Licensed under the [MIT](https://github.com/mochi-neko/ChatGPT-API-unity/blob/main/LICENSE) license.
217+
Licensed under the [MIT](./LICENSE) license.

0 commit comments

Comments
 (0)