:zap: [Enhance] ChatAPIApp: Only include schema for non-prefix route
Browse files- apis/chat_api.py +3 -0
apis/chat_api.py
CHANGED
@@ -125,14 +125,17 @@ class ChatAPIApp:
|
|
125 |
|
126 |
def setup_routes(self):
|
127 |
for prefix in ["", "/v1", "/api", "/api/v1"]:
|
|
|
128 |
self.app.get(
|
129 |
prefix + "/models",
|
130 |
summary="Get available models",
|
|
|
131 |
)(self.get_available_models)
|
132 |
|
133 |
self.app.post(
|
134 |
prefix + "/chat/completions",
|
135 |
summary="Chat completions in conversation session",
|
|
|
136 |
)(self.chat_completions)
|
137 |
|
138 |
|
|
|
125 |
|
126 |
def setup_routes(self):
|
127 |
for prefix in ["", "/v1", "/api", "/api/v1"]:
|
128 |
+
include_in_schema = True if prefix == "" else False
|
129 |
self.app.get(
|
130 |
prefix + "/models",
|
131 |
summary="Get available models",
|
132 |
+
include_in_schema=include_in_schema,
|
133 |
)(self.get_available_models)
|
134 |
|
135 |
self.app.post(
|
136 |
prefix + "/chat/completions",
|
137 |
summary="Chat completions in conversation session",
|
138 |
+
include_in_schema=include_in_schema,
|
139 |
)(self.chat_completions)
|
140 |
|
141 |
|