Commit Graph

20 Commits

Author SHA1 Message Date
渡邉祐一 / Yuichi Watanabe
181fc2ade9 docs: explanation about LogitBias. (129) (#426) 2023-07-09 12:11:39 +03:00
James MacWhyte
0ca4ea4867 move json schema to directory/package (#407)
* move json schema to directory/package

* added jsonschema to README
2023-06-24 20:22:11 +04:00
渡邉祐一 / Yuichi Watanabe
f1b66967a4 refactor: refactoring http request creation and sending (#395)
* refactoring http request creation and sending

* fix lint error

* increase the test coverage of client.go

* refactor: Change the style of HTTPRequestBuilder.Build func to one-argument-per-line.
2023-06-22 13:57:52 +04:00
Chris Hua
f22da8a7ed feat: allow more input types to functions, fix tests (#377)
* feat: use json.rawMessage, test functions

* chore: lint

* fix: tests

the ChatCompletion mock server doesn't actually run otherwise. N=0
is the default request but the server will treat it as n=1

* fix: tests should default to n=1 completions

* chore: add back removed interfaces, custom marshal

* chore: lint

* chore: lint

* chore: add some tests

* chore: appease lint

* clean up JSON schema + tests

* chore: lint

* feat: remove backwards compatible functions

for illustrative purposes

* fix: revert params change

* chore: use interface{}

* chore: add test

* chore: add back FunctionDefine

* chore: /s/interface{}/any

* chore: add back jsonschemadefinition

* chore: testcov

* chore: lint

* chore: remove pointers

* chore: update comment

* chore: address CR

added test for compatibility as well

---------

Co-authored-by: James <jmacwhyte@MacBooger-II.local>
2023-06-21 16:58:27 +04:00
Alex Wormuth
ac25f318ba add items, which is required for array type (#373)
* add items, which is required for array type

* use JSONSchemaDefine directly
2023-06-16 17:11:50 +04:00
Ccheers
2bd65aa720 feat(chat): support function call api (#369)
* feat(chat): support function call api

* rename struct & add const ChatMessageRoleFunction
2023-06-15 12:49:54 +04:00
渡邉祐一 / Yuichi Watanabe
61ba5f3369 move request_builder into internal pkg (#304) (#329)
* move request_builder into internal pkg (#304)

* add some test for internal.RequestBuilder

* add a test for openai.GetEngine
2023-05-31 12:01:42 +04:00
GargantuaX
be253c2d63 change azure engine config to modelMapper (#306)
* change azure engine config to azure modelMapper config

* Update go.mod

* Revert "Update go.mod"

This reverts commit 78d14c58f2a9ce668da43f6adbe20b60afcfe0d7.

* lint fix

* add test

* lint fix

* lint fix

* lint fix

* opt

* opt

* opt

* opt
2023-05-11 01:30:24 +04:00
Jo
2ebb265e71 refactor: Refactor endpoint and model compatibility check (#180)
* Add model check for chat stream

* Sync model checks

* Fix typo

* Fix functino

* refactor: Refactor endpoint and model compatibility check

* apply review suggestions

* minor fix

* invert return boolean flag

* fix test
2023-03-22 17:46:08 +04:00
sashabaranov
a6b35c3ab5 Check for Stream parameter usage (#174)
* check for stream:true usage

* lint
2023-03-18 19:31:54 +04:00
sashabaranov
abffeceb71 Check for GPT-4 models (#169)
* add chat gpt4 model support (#158)

* remove check for gpt4 for CreateCompletion

* test for model check

---------

Co-authored-by: aeieli <aeliieli@gmail.com>
2023-03-16 10:43:41 +04:00
sashabaranov
c34bc77f1a Add testable request builder (#162)
* Add testable request builder

* improve tests
2023-03-15 13:16:33 +04:00
sashabaranov
53d195cf5a add testable json marshaller (#161) 2023-03-15 12:16:47 +04:00
Constantine A
c5fe8742cc add "name" property for ChatCompletionMessage (#123) 2023-03-06 10:52:56 +04:00
Alexander Baranov
9eea94730a rename internally 2023-03-04 15:29:42 +04:00
fishcg
d1a81205bf Add chat message role const (#111) 2023-03-03 13:07:09 +04:00
Afeyer
39ca4e9488 Implement chat completion streaming (#101)
* Implement chat completion streaming

* Optimize the implementation of chat completion stream

* Fix linter error
2023-03-03 09:52:02 +04:00
bestgopher
58d99eb220 refactor: use http.NewRequestWithContext instead of http.NewRequest (#97) 2023-03-02 10:27:09 +04:00
Parham Negahdar
de9a632138 Add the rest of the Chat Completion fields (#92)
Per https://platform.openai.com/docs/api-reference/chat/create
2023-03-02 10:06:24 +04:00
sashabaranov
c8261c5638 Add chat completions (#90) 2023-03-02 00:47:25 +04:00