Documentation
¶
Index ¶
- type Resolution
- type SideKick
- func (utility *SideKick) CalculateNewDimensions(bounds image.Rectangle, maxSize int) (int, int)
- func (utility *SideKick) ClearLine(termconfig models.Terminal)
- func (utility *SideKick) CreateAssistantMessage(input string) models.Message
- func (utility *SideKick) CreateEmbeddingRequest(model models.Model, input []string) models.EmbeddingRequest
- func (utility *SideKick) CreateMessage(role models.Role, input string) models.Message
- func (utility *SideKick) CreateMessageWithImages(role models.Role, input string, images *[]models.Base64Image) models.Message
- func (utility *SideKick) CreateModerationRequest(input string) models.ModerationRequest
- func (utility *SideKick) CreateUserMessage(input string, images *[]models.Base64Image) models.Message
- func (utility *SideKick) Debug(payload string, termconfig models.Terminal)
- func (utility *SideKick) DecodeImage(imageBytes []byte) (image.Image, string, error)
- func (utility *SideKick) EncodeImage(img image.Image, format string) ([]byte, error)
- func (utility *SideKick) Error(err error)
- func (utility *SideKick) PrepareArray(messages []models.Message, includeStrategy models.IncludeStrategy, ...) []models.Message
- func (utility *SideKick) Print(content string, termconfig models.Terminal)
- func (utility *SideKick) Println(content string, termconfig models.Terminal)
- func (utility *SideKick) ReadFile(filepath string) ([]byte, error)
- func (utility *SideKick) Resize(img image.Image, newWidth, newHeight int) image.Image
- func (utility *SideKick) ResizeImage(imageBytes []byte, maxSize int) ([]byte, error)
- func (utility *SideKick) RunFunction(httpClient *http.Client, tool models.Tool, payload models.FunctionPayload, ...) (models.FunctionResponse, error)
- func (utility *SideKick) Trace(payload string, termconfig models.Terminal)
- func (utility *SideKick) VerifyStatus(resp *http.Response) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolution ¶
type Resolution int
Resolution represents different image resolutions.
const ( Res4K Resolution = 3840 Res2K Resolution = 2048 Res1080p Resolution = 1920 Res720p Resolution = 1280 Res480p Resolution = 640 Res360p Resolution = 480 Res320p Resolution = 320 Res240p Resolution = 320 Res144p Resolution = 256 Pixel1024 Resolution = 1024 Pixel512 Resolution = 512 )
type SideKick ¶
type SideKick struct {
}
func (*SideKick) CalculateNewDimensions ¶
CalculateNewDimensions calculates the new width and height while maintaining the aspect ratio.
func (*SideKick) ClearLine ¶
ClearLine clears the current line if output is enabled in the configuration
func (*SideKick) CreateAssistantMessage ¶
CreateAssistantMessage creates a new assistant message with the given input string
func (*SideKick) CreateEmbeddingRequest ¶
func (*SideKick) CreateMessage ¶
createMessage creates a new message with the given role and content.
func (*SideKick) CreateMessageWithImages ¶
func (utility *SideKick) CreateMessageWithImages(role models.Role, input string, images *[]models.Base64Image) models.Message
CreateMessageWithImages creates a new message with the given role, content and images
func (*SideKick) CreateModerationRequest ¶
func (utility *SideKick) CreateModerationRequest(input string) models.ModerationRequest
func (*SideKick) CreateUserMessage ¶
func (utility *SideKick) CreateUserMessage(input string, images *[]models.Base64Image) models.Message
CreateUserMessage creates a new user message with the given input string
func (*SideKick) DecodeImage ¶
DecodeImage decodes image bytes into an image.Image and detects the format.
func (*SideKick) EncodeImage ¶
EncodeImage encodes an image into a specific format (JPEG, PNG, etc.).
func (*SideKick) PrepareArray ¶
func (utility *SideKick) PrepareArray(messages []models.Message, includeStrategy models.IncludeStrategy, maxMessages int) []models.Message
PrepareArray prepares an array of messages based on the includeStrategy.
func (*SideKick) Println ¶
Println prints the given content to the console with color and a newline character, then resets the color.
func (*SideKick) Resize ¶
Resize resizes an image to the specified width and height using high-quality scaling.
func (*SideKick) ResizeImage ¶
ResizeImage resizes an image to the specified maximum dimension while maintaining its aspect ratio. Larger dimension (width or height) will be resized to maxSize. Input: imageBytes []byte (image data), maxSize int (max dimension). Output: Resized image as []byte, error if any issue occurs.