feat: Refactor vision message handling and increase commit short SHA length

- Increase the length of the commit short SHA from 8 to 7 characters
- Update relay-aiproxy.go to handle multiple content types in the last message
- Refactor and modify countVisonTokenMessages function in relay-utils.go to handle different content types and update token counts accordingly
- Update VisionMessage struct in relay.go to have Content as a slice of OpenaiVisionMessageContent
This commit is contained in:
Laisky.Cai
2023-11-17 05:26:26 +00:00
parent 0cafbf0fc9
commit 14108ce24d
4 changed files with 27 additions and 17 deletions

View File

@@ -19,9 +19,9 @@ type Message struct {
}
type VisionMessage struct {
Role string `json:"role"`
Content OpenaiVisionMessageContent `json:"content"`
Name *string `json:"name,omitempty"`
Role string `json:"role"`
Content []OpenaiVisionMessageContent `json:"content"`
Name *string `json:"name,omitempty"`
}
// OpenaiVisionMessageContentType vision message content type