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

Function chatMessagePartTSName

scripts/apitypings/main.go:302–310  ·  view source on GitHub ↗

chatMessagePartTSName derives a TypeScript interface name from a ChatMessagePartType literal. "tool-call" → "ChatToolCallPart".

(t codersdk.ChatMessagePartType)

Source from the content-addressed store, hash-verified

300// chatMessagePartTSName derives a TypeScript interface name from
301// a ChatMessagePartType literal. "tool-call" → "ChatToolCallPart".
302func chatMessagePartTSName(t codersdk.ChatMessagePartType) string {
303 words := strings.Split(string(t), "-")
304 for i, w := range words {
305 if len(w) > 0 {
306 words[i] = strings.ToUpper(w[:1]) + w[1:]
307 }
308 }
309 return "Chat" + strings.Join(words, "") + "Part"
310}
311
312// FixSerpentStruct fixes 'serpent.Struct'.
313// 'serpent.Struct' overrides the json.Marshal to use the underlying type,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected