Skip to content

Commit

Permalink
updated checkPromptType function to handle prompt list in completions
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushSawant18588 committed Oct 22, 2024
1 parent 3672c0d commit 6c18c8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,17 @@ func checkEndpointSupportsModel(endpoint, model string) bool {
func checkPromptType(prompt any) bool {
_, isString := prompt.(string)
_, isStringSlice := prompt.([]string)
return isString || isStringSlice
isInterfaceSlice := false
if slice, isSlice := prompt.([]interface{}); isSlice {
isInterfaceSlice = true
for _, item := range slice {
if _, isStringItem := item.(string); !isStringItem {
isInterfaceSlice = false
break
}
}
}
return isString || isStringSlice || isInterfaceSlice
}

var unsupportedToolsForO1Models = map[ToolType]struct{}{
Expand Down
1 change: 1 addition & 0 deletions test.mp3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello

0 comments on commit 6c18c8f

Please sign in to comment.