valobj

package
v0.0.0-...-e90dbcc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContentTypeText ContentType = "text"
	RoleUser        Role        = "user"
	RoleAssistant   Role        = "assistant"
)

Functions

This section is empty.

Types

type ContentType

type ContentType string

type ConversationJSONBody

type ConversationJSONBody struct {
	Action          string   `json:"action"`
	ConversationId  string   `json:"conversation_id,omitempty"`
	Messages        []Prompt `json:"messages"`
	Model           string   `json:"model"`
	ParentMessageId string   `json:"parent_message_id"`
}

type ConversationResponse

type ConversationResponse struct {
	Message        Prompt `json:"message"`
	ConversationId string `json:"conversation_id"`
	Error          error  `json:"error,omitempty"`
}

func GetConversationResponse

func GetConversationResponse(content []byte) (*ConversationResponse, error)

func (*ConversationResponse) GetMessage

func (r *ConversationResponse) GetMessage() *string

type Message

type Message struct {
	ConvId   string `json:"convId"`
	ParentId string `json:"parentId"`
	Message  string `json:"message"`
}

type Prompt

type Prompt struct {
	Content PromptContent `json:"content"`
	Id      string        `json:"id"`
	Role    Role          `json:"role"`
}

type PromptContent

type PromptContent struct {
	ContentType ContentType `json:"content_type"`
	Parts       []string    `json:"parts"`
}

type Role

type Role string

type SessionResult

type SessionResult struct {
	User        User      `json:"user"`
	Expires     time.Time `json:"expires"`
	AccessToken string    `json:"accessToken"`
	Error       string    `json:"error,omitempty"`
}

type User

type User struct {
	Id       string   `json:"id"`
	Name     string   `json:"name"`
	Email    string   `json:"email"`
	Image    string   `json:"image"`
	Picture  string   `json:"picture"`
	Groups   []string `json:"groups"`
	Features []string `json:"features"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL