plugins

package
v3.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LLMPluginName = "LLMHoneypot"
)

Variables

This section is empty.

Functions

func InitBeelzebubCloud added in v3.1.8

func InitBeelzebubCloud(uri, authToken string) *beelzebubCloud

Types

type Choice

type Choice struct {
	Message      Message `json:"message"`
	Index        int     `json:"index"`
	FinishReason string  `json:"finish_reason"`
}

type HoneypotConfigResponseDTO added in v3.2.3

type HoneypotConfigResponseDTO struct {
	ID            string `json:"id"`
	Config        string `json:"config"`
	TokenID       string `json:"tokenId"`
	LastUpdatedOn string `json:"lastUpdatedOn"`
}

type LLMHoneypot added in v3.2.2

type LLMHoneypot struct {
	Histories []Message
	OpenAIKey string

	Protocol     tracer.Protocol
	Provider     LLMProvider
	Model        string
	Host         string
	CustomPrompt string
	// contains filtered or unexported fields
}

func InitLLMHoneypot added in v3.2.2

func InitLLMHoneypot(config LLMHoneypot) *LLMHoneypot

func (*LLMHoneypot) ExecuteModel added in v3.2.2

func (llmHoneypot *LLMHoneypot) ExecuteModel(command string) (string, error)

type LLMProvider added in v3.3.5

type LLMProvider int
const (
	Ollama LLMProvider = iota
	OpenAI
)

func FromStringToLLMProvider added in v3.3.5

func FromStringToLLMProvider(llmProvider string) (LLMProvider, error)

type Message added in v3.2.0

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type Request added in v3.2.2

type Request struct {
	Model    string    `json:"model"`
	Messages []Message `json:"messages"`
	Stream   bool      `json:"stream"`
}

type Response added in v3.2.2

type Response struct {
	ID      string   `json:"id"`
	Object  string   `json:"object"`
	Created int      `json:"created"`
	Model   string   `json:"model"`
	Choices []Choice `json:"choices"`
	Message Message  `json:"message"`
	Usage   struct {
		PromptTokens     int `json:"prompt_tokens"`
		CompletionTokens int `json:"completion_tokens"`
		TotalTokens      int `json:"total_tokens"`
	} `json:"usage"`
}

type Role added in v3.2.0

type Role int
const (
	SYSTEM Role = iota
	USER
	ASSISTANT
)

func (Role) String added in v3.2.0

func (role Role) String() string

Jump to

Keyboard shortcuts

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