Documentation
¶
Index ¶
- func ConvertDataUserFile(blockText string) (bool, *uctypes.UIMessagePart)
- func ExtractImageUrl(data []byte, url, mimeType string) (string, error)
- func ExtractTextData(data []byte, url string) ([]byte, error)
- func ExtractXmlAttribute(tag, attrName string) (string, bool)
- func FormatAttachedDirectoryListing(directoryName, jsonContent string) string
- func FormatAttachedTextFile(fileName string, textContent []byte) string
- func GenerateDeterministicSuffix(inputs ...string) string
- func JsonEncodeRequestBody(reqBody any) (bytes.Buffer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDataUserFile ¶
func ConvertDataUserFile(blockText string) (bool, *uctypes.UIMessagePart)
ConvertDataUserFile converts OpenAI attached file/directory blocks to UIMessagePart Returns (found, part) where found indicates if the prefix was matched, and part is the converted UIMessagePart (can be nil if parsing failed)
func ExtractImageUrl ¶
ExtractImageUrl extracts an image URL from either URL field (http/https/data) or raw Data
func ExtractTextData ¶
ExtractTextData extracts text data from either Data field or URL field (data: URLs only)
func ExtractXmlAttribute ¶
ExtractXmlAttribute extracts an attribute value from an XML-like tag. Expects double-quoted strings where internal quotes are encoded as ". Returns the unquoted value and true if found, or empty string and false if not found or invalid.
func FormatAttachedDirectoryListing ¶
FormatAttachedDirectoryListing formats a directory listing attachment with proper encoding and deterministic suffix
func FormatAttachedTextFile ¶
FormatAttachedTextFile formats a text file attachment with proper encoding and deterministic suffix
func GenerateDeterministicSuffix ¶
GenerateDeterministicSuffix creates an 8-character hash from input strings
Types ¶
This section is empty.