gpt

package
v0.0.0-...-90f7d4a Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

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

type Messages

type Messages struct {
	ID      string  `json:"id"`
	Role    string  `json:"role"`
	Content Content `json:"content"`
}

type Request

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

type Response

type Response struct {
	Message struct {
		ID         string      `json:"id"`
		Role       string      `json:"role"`
		User       interface{} `json:"user"`
		CreateTime interface{} `json:"create_time"`
		UpdateTime interface{} `json:"update_time"`
		Content    struct {
			ContentType string   `json:"content_type"`
			Parts       []string `json:"parts"`
		} `json:"content"`
		EndTurn  interface{} `json:"end_turn"`
		Weight   float64     `json:"weight"`
		Metadata struct {
		} `json:"metadata"`
		Recipient string `json:"recipient"`
	} `json:"message"`
	ConversationID string      `json:"conversation_id"`
	Error          interface{} `json:"error"`
}

func GetRawCompletion

func GetRawCompletion(ctx intercept.Context, rr Request, cb func(s string)) (*Response, error)

Jump to

Keyboard shortcuts

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