MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / genMessageSchema

Function genMessageSchema

module/ai-api/schema.go:124–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122}
123
124func genMessageSchema() *openapi3.Schema {
125 result := openapi3.NewObjectSchema()
126 result.Title = "Message"
127 result.Description = "Chat Message"
128 roleSchema := openapi3.NewStringSchema()
129 roleSchema.Description = "Role of the message sender"
130 roleSchema.Example = "user"
131 contentSchema := openapi3.NewStringSchema()
132 contentSchema.Description = "The message content"
133 contentSchema.Example = "Hello, who are you?"
134 result.WithProperties(map[string]*openapi3.Schema{
135 "role": roleSchema,
136 "content": contentSchema,
137 })
138
139 result.WithRequired([]string{"role", "content"})
140 return result
141}
142
143func genMessagesSchema() *openapi3.Schema {
144 result := openapi3.NewArraySchema()

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected