Skip to content

Commit

Permalink
Deprecations and Fine Tuning (#12)
Browse files Browse the repository at this point in the history
* Updated model for completions test

* Removed obsolete edits package

* Added support for fine-tuning endpoint

* Removed accidentally committed binary files

* Updated .gitignore

* Deprecated the completions endpoint
  • Loading branch information
Kardbord committed Jan 14, 2024
1 parent ac38704 commit 94e84e0
Show file tree
Hide file tree
Showing 16 changed files with 308 additions and 467 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ dist/
examples/audio/audio
examples/chat/chat
examples/completions/completions
examples/edits/edits
examples/embeddings/embeddings
examples/files/files
examples/finetunes/finetunes
examples/finetuning/finetuning
examples/images/images
examples/models/models
examples/moderations/moderations
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ The links below lead to examples of how to use each library package.
- [x] [Audio](./audio/README.md)
- [x] [Chat](./chat/README.md)
- [x] [Completions](./completions/README.md)
- [x] ~~[Edits](./edits/README.md)~~ (Deprecated)
- [x] [Embeddings](./embeddings/README.md)
- [ ] Fine-Tuning
- [x] [Files](./files/README.md)
- [x] ~~[Fine-Tunes](./finetunes/README.md)~~ (Deprecated)
- [x] [Fine-Tuning](./finetuning/README.md)
- [x] [Images](./images/README.md)
- [x] [Models](./models/README.md)
- [x] [Moderations](./moderations/README.md)
Expand Down
4 changes: 4 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ type responseErrorWrapper struct {
type ResponseError struct {
// The error message.
Message string `json:"message"`

// The error type.
Type string `json:"type"`

// The parameter that was invalid.
Param string `json:"param"`
}

func (e *ResponseError) Error() string {
Expand Down
1 change: 1 addition & 0 deletions completions/completions.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Deprecated: Replaced by Chat Completions. See https://platform.openai.com/docs/api-reference/completions.
// Package completions provides bindings for the [completions] [endpoint].
// Given a prompt, the model will return one or more predicted completions,
// and can also return the probabilities of alternative tokens at each position.
Expand Down
2 changes: 1 addition & 1 deletion completions/completions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func init() {

func TestCompletions(t *testing.T) {
resp, err := completions.MakeRequest(&completions.Request{
Model: "text-ada-001",
Model: "gpt-3.5-turbo-instruct",
Prompt: []string{"So long, and thanks for all the"},
MaxTokens: 5,
Echo: true,
Expand Down
7 changes: 0 additions & 7 deletions edits/README.md

This file was deleted.

98 changes: 0 additions & 98 deletions edits/edits.go

This file was deleted.

31 changes: 0 additions & 31 deletions edits/edits_test.go

This file was deleted.

33 changes: 0 additions & 33 deletions examples/edits/edits-example.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/Kardbord/gopenai/authentication"
"github.com/Kardbord/gopenai/finetunes"
"github.com/Kardbord/gopenai/finetuning"
_ "github.com/joho/godotenv/autoload"
)

Expand All @@ -19,7 +19,7 @@ func init() {
func main() {
// TODO: build a more comprehensive example of how to use this endpoint.

resp, err := finetunes.MakeListRequest(nil)
resp, err := finetuning.MakeListRequest(nil, nil, nil)
if err != nil {
fmt.Println(err)
return
Expand Down
9 changes: 0 additions & 9 deletions finetunes/README.md

This file was deleted.

Loading

0 comments on commit 94e84e0

Please sign in to comment.