copilot

package
v0.0.0-...-d8ceb07 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 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 ChatChoice

type ChatChoice struct {
	Index   int         `json:"index"`
	Message ChatMessage `json:"message"`
}

type ChatCompletionsRequest

type ChatCompletionsRequest struct {
	Messages []ChatMessage  `json:"messages"`
	Model    Model          `json:"model"`
	Tools    []FunctionTool `json:"tools"`
}

type ChatCompletionsResponse

type ChatCompletionsResponse struct {
	Choices []ChatChoice `json:"choices"`
}

func ChatCompletions

func ChatCompletions(ctx context.Context, integrationID, apiKey string, req *ChatCompletionsRequest) (*ChatCompletionsResponse, error)

type ChatConfirmation

type ChatConfirmation struct {
	State        string            `json:"state"`
	Confirmation *ConfirmationData `json:"confirmation"`
}

type ChatMessage

type ChatMessage struct {
	Role          string              `json:"role"`
	Content       string              `json:"content"`
	Confirmations []*ChatConfirmation `json:"copilot_confirmations"`
	ToolCalls     []*ToolCall         `json:"tool_calls"`
}

type ChatMessageFunctionCall

type ChatMessageFunctionCall struct {
	Name      string `json:"name"`
	Arguments string `json:"arguments"`
}

type ChatRequest

type ChatRequest struct {
	Messages []ChatMessage `json:"messages"`
}

type ConfirmationData

type ConfirmationData struct {
	Owner string `json:"owner"`
	Repo  string `json:"repo"`
	Title string `json:"title"`
	Body  string `json:"body"`
}

type Function

type Function struct {
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Parameters  *jsonschema.Schema `json:"parameters"`
}

type FunctionTool

type FunctionTool struct {
	Type     string   `json:"type"`
	Function Function `json:"function"`
}

type Model

type Model string
const (
	ModelGPT35 Model = "gpt-3.5-turbo"
	ModelGPT4  Model = "gpt-4"
)

type ResponseConfirmation

type ResponseConfirmation struct {
	Type         string            `json:"type"`
	Title        string            `json:"title"`
	Message      string            `json:"message"`
	Confirmation *ConfirmationData `json:"confirmation"`
}

type ToolCall

type ToolCall struct {
	Function *ChatMessageFunctionCall `json:"function"`
}

Jump to

Keyboard shortcuts

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