Migrate From Old Completions + Embedding Endpoint (#28)

* migrate away from deprecated OpenAI endpoints

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* test embedding correctness

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
This commit is contained in:
Oleg
2022-08-02 04:16:54 -04:00
committed by GitHub
parent 51f94a6ab3
commit 53212c71df
5 changed files with 69 additions and 37 deletions

View File

@@ -27,10 +27,11 @@ func main() {
ctx := context.Background()
req := gogpt.CompletionRequest{
Model: "ada",
MaxTokens: 5,
Prompt: "Lorem ipsum",
}
resp, err := c.CreateCompletion(ctx, "ada", req)
resp, err := c.CreateCompletion(ctx, req)
if err != nil {
return
}