| 122 | } |
| 123 | |
| 124 | func 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 | |
| 143 | func genMessagesSchema() *openapi3.Schema { |
| 144 | result := openapi3.NewArraySchema() |