-
Notifications
You must be signed in to change notification settings - Fork 1
/
session.go
31 lines (29 loc) · 1018 Bytes
/
session.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package gopenai
import (
"github.com/wikylyu/gopenai/api"
"github.com/wikylyu/gopenai/audio"
"github.com/wikylyu/gopenai/chat"
"github.com/wikylyu/gopenai/completions"
"github.com/wikylyu/gopenai/edits"
"github.com/wikylyu/gopenai/embeddings"
"github.com/wikylyu/gopenai/files"
"github.com/wikylyu/gopenai/finetunes"
"github.com/wikylyu/gopenai/images"
"github.com/wikylyu/gopenai/models"
"github.com/wikylyu/gopenai/moderations"
)
func New(cfg *Config) *Session {
client := api.NewClient(cfg.BaseURL, cfg.ApiKey, cfg.MaxIdleConns, cfg.IdleConnTimeout, cfg.HttpsProxy)
return &Session{
Model: models.NewClient(client),
Completion: completions.NewClient(client),
Edit: edits.NewClient(client),
Image: images.NewClient(client),
Embedding: embeddings.NewClient(client),
File: files.NewClient(client),
FineTune: finetunes.NewClient(client),
Moderation: moderations.NewClient(client),
Chat: chat.NewClient(client),
Audio: audio.NewClient(client),
}
}