Documentation
¶
Index ¶
- Constants
- func DataURL(mime string, data []byte) string
- func DetectMIME(path string, data []byte) string
- func FormatReadImageResult(path, mime string, size int64) string
- func FormatReadImageTooLarge(path string, size, max int64) string
- func IsImage(mimeType, path string) bool
- func IsImageMIME(mime string) bool
- func IsImagePath(path string) bool
- func LoadWorkspaceImage(ctx context.Context, ws workspace.Service, workRel string, maxBytes int) ([]byte, string, error)
- func NormalizeWorkRel(rel string) string
- func ParseReadImagePath(content string) string
Constants ¶
const ContentTypeAttachmentRef = "attachment_ref"
ContentTypeAttachmentRef is persisted in session history for stripped attachments.
const DefaultMaxWorkspaceImageBytes = 10 << 20
DefaultMaxWorkspaceImageBytes caps workspace images loaded for vision.
Variables ¶
This section is empty.
Functions ¶
func DetectMIME ¶
DetectMIME guesses image MIME type from path and magic bytes.
func FormatReadImageResult ¶
FormatReadImageResult is the read-tool metadata format hydrated before LLM calls.
func FormatReadImageTooLarge ¶
FormatReadImageTooLarge explains why a workspace image cannot be viewed.
func IsImageMIME ¶
IsImageMIME reports whether a MIME type is an image.
func IsImagePath ¶
IsImagePath reports whether a workspace-relative path looks like an image file.
func LoadWorkspaceImage ¶
func LoadWorkspaceImage(ctx context.Context, ws workspace.Service, workRel string, maxBytes int) ([]byte, string, error)
LoadWorkspaceImage reads an image from the tenant work tree. workRel is relative to work/ (e.g. upload/foo.png or work/upload/foo.png).
func NormalizeWorkRel ¶
NormalizeWorkRel strips leading slashes and an optional work/ prefix.
func ParseReadImagePath ¶
ParseReadImagePath extracts a workspace image path from a read-tool result.
Types ¶
This section is empty.