mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-12 23:15:05 -05:00
### CHANGES - Introduce `cmd` directory for all main application binaries. - Move all Go packages into the `internal` directory. - Rename the `restapi` package to `server` for clarity. - Consolidate patterns and strategies into a new `data` directory. - Group all auxiliary scripts into a new `scripts` directory. - Move all documentation and images into a `docs` directory. - Update all Go import paths to reflect the new structure. - Adjust CI/CD workflows and build commands for new layout.
22 lines
609 B
Go
22 lines
609 B
Go
package openai
|
|
|
|
import "github.com/danielmiessler/fabric/internal/chat"
|
|
|
|
// MessageConversionResult holds the common conversion result
|
|
type MessageConversionResult struct {
|
|
Role string
|
|
Content string
|
|
MultiContent []chat.ChatMessagePart
|
|
HasMultiContent bool
|
|
}
|
|
|
|
// convertMessageCommon extracts common conversion logic
|
|
func convertMessageCommon(msg chat.ChatCompletionMessage) MessageConversionResult {
|
|
return MessageConversionResult{
|
|
Role: msg.Role,
|
|
Content: msg.Content,
|
|
MultiContent: msg.MultiContent,
|
|
HasMultiContent: len(msg.MultiContent) > 0,
|
|
}
|
|
}
|