MCPcopy Create free account
hub / github.com/coder/coder / IncludeFromChat

Function IncludeFromChat

coderd/x/chatd/chatopenai/options.go:90–107  ·  view source on GitHub ↗

IncludeFromChat converts chat-config include values to OpenAI Responses include values and ignores unsupported entries.

(values []string)

Source from the content-addressed store, hash-verified

88// IncludeFromChat converts chat-config include values to OpenAI Responses
89// include values and ignores unsupported entries.
90func IncludeFromChat(values []string) []fantasyopenai.IncludeType {
91 if values == nil {
92 return nil
93 }
94
95 result := make([]fantasyopenai.IncludeType, 0, len(values))
96 for _, value := range values {
97 switch strings.TrimSpace(value) {
98 case string(fantasyopenai.IncludeReasoningEncryptedContent):
99 result = append(result, fantasyopenai.IncludeReasoningEncryptedContent)
100 case string(fantasyopenai.IncludeFileSearchCallResults):
101 result = append(result, fantasyopenai.IncludeFileSearchCallResults)
102 case string(fantasyopenai.IncludeMessageOutputTextLogprobs):
103 result = append(result, fantasyopenai.IncludeMessageOutputTextLogprobs)
104 }
105 }
106 return result
107}
108
109// EnsureResponseIncludes adds the OpenAI encrypted reasoning include required
110// for Responses API reasoning continuity when it is not already present.

Callers 2

TestIncludeFromChatFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestIncludeFromChatFunction · 0.74