Content-Length: 272860 | pFad | https://github.com/AlmazDelDiablo/gpt3-5-turbo-go

5E GitHub - AlmazDelDiablo/gpt3-5-turbo-go: Golang client for official API of ChatGPT (GPT-3.5-turbo)
Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Golang client for official API of ChatGPT (GPT-3.5-turbo)

License

Notifications You must be signed in to change notification settings

AlmazDelDiablo/gpt3-5-turbo-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoLang HTTP Client for ChatGPT (GPT-3.5-turbo)

A client for an official API of chat completions (known as ChatGPT) based on gpt-3.5-turbo model. Here's a guide by Open AI: https://platform.openai.com/docs/guides/chat.

Created & generated by Sergei Zaikin & OpenAI ChatGPT.

Install

go get github.com/AlmazDelDiablo/gpt3-5-turbo-go

Usage

package main

import (
	gpt35 "github.com/AlmazDelDiablo/gpt3-5-turbo-go"
)

func main() {
	c, _ := gpt35.NewClient("sk-xxxxxxxxxxxxxxxxxxxx")
	req := &gpt35.Request{
		Model: gpt35.ModelGpt35Turbo,
		Messages: []*gpt35.Message{
			{
				Role:    gpt35.RoleUser,
				Content: "Hello",
			},
		},
	}

	resp, err := c.GetChat(req)
	if err != nil {
		panic(err)
	}

	println(resp.Choices[0].Message.Content)
	println(resp.Usage.PromptTokens)
	println(resp.Usage.CompletionTokens)
	println(resp.Usage.TotalTokens)
}

About

Golang client for official API of ChatGPT (GPT-3.5-turbo)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/AlmazDelDiablo/gpt3-5-turbo-go

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy