Skip to content

A small library that interacts with openAI's language model

License

Notifications You must be signed in to change notification settings

canack/sentient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentient

Warning: This library is still in development and is not yet ready for production use.


Mini library which works with OpenAI's models

Please check the mini example

git clone https://github.com/canack/sentient.git

cd sentient/cmd/sentient

OPENAI_API_KEY="API_KEY" go run .

Usage/Demo:

go get github.com/canack/sentient
package main

import (
	"fmt"
	"log"
	"os"

	"github.com/canack/sentient/pkg/tools"
)

func main() {
	var davinci = tools.Davinci{
		MaxTokens:   300,
		Temperature: 0.05,
	}

	chat := tools.NewChatBot(&davinci)
	chat.Setup("OPENAI_API_KEY")

	log.Println("Testing connection to OpenAI API...")
	if err := chat.TestConnection(); err != nil {
		log.Printf("chatbot connection failed: %v\n", err)
		os.Exit(1)
	}
	log.Println("Connection successful!")

	message := davinci.Query("Hi, how are you?")
	fmt.Println(message.Pretty())
}

License: MIT

About

A small library that interacts with openAI's language model

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages