Skip to content

Commit f843245

Browse files
authored
Merge pull request #352 from tisnik/lcore-390-description-for-all-query-request-fields
LCORE-390: description for all QueryRequest fields
2 parents b5afee1 + 829f97f commit f843245

File tree

4 files changed

+135
-32
lines changed

4 files changed

+135
-32
lines changed

docs/openapi.json

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,11 @@
14061406
"properties": {
14071407
"query": {
14081408
"type": "string",
1409-
"title": "Query"
1409+
"title": "Query",
1410+
"description": "The query string",
1411+
"examples": [
1412+
"What is Kubernetes?"
1413+
]
14101414
},
14111415
"conversation_id": {
14121416
"anyOf": [
@@ -1417,7 +1421,11 @@
14171421
"type": "null"
14181422
}
14191423
],
1420-
"title": "Conversation Id"
1424+
"title": "Conversation Id",
1425+
"description": "The optional conversation ID (UUID)",
1426+
"examples": [
1427+
"c5260aec-4d82-4370-9fdf-05cf908b3f16"
1428+
]
14211429
},
14221430
"provider": {
14231431
"anyOf": [
@@ -1428,7 +1436,12 @@
14281436
"type": "null"
14291437
}
14301438
],
1431-
"title": "Provider"
1439+
"title": "Provider",
1440+
"description": "The optional provider",
1441+
"examples": [
1442+
"openai",
1443+
"watsonx"
1444+
]
14321445
},
14331446
"model": {
14341447
"anyOf": [
@@ -1439,7 +1452,11 @@
14391452
"type": "null"
14401453
}
14411454
],
1442-
"title": "Model"
1455+
"title": "Model",
1456+
"description": "The optional model",
1457+
"examples": [
1458+
"gpt4mini"
1459+
]
14431460
},
14441461
"system_prompt": {
14451462
"anyOf": [
@@ -1450,7 +1467,12 @@
14501467
"type": "null"
14511468
}
14521469
],
1453-
"title": "System Prompt"
1470+
"title": "System Prompt",
1471+
"description": "The optional system prompt.",
1472+
"examples": [
1473+
"You are OpenShift assistant.",
1474+
"You are Ansible assistant."
1475+
]
14541476
},
14551477
"attachments": {
14561478
"anyOf": [
@@ -1464,7 +1486,25 @@
14641486
"type": "null"
14651487
}
14661488
],
1467-
"title": "Attachments"
1489+
"title": "Attachments",
1490+
"description": "The optional list of attachments.",
1491+
"examples": [
1492+
{
1493+
"attachment_type": "log",
1494+
"content": "this is attachment",
1495+
"content_type": "text/plain"
1496+
},
1497+
{
1498+
"attachment_type": "configuration",
1499+
"content": "kind: Pod\n metadata:\n name: private-reg",
1500+
"content_type": "application/yaml"
1501+
},
1502+
{
1503+
"attachment_type": "configuration",
1504+
"content": "foo: bar",
1505+
"content_type": "application/yaml"
1506+
}
1507+
]
14681508
},
14691509
"no_tools": {
14701510
"anyOf": [
@@ -1476,7 +1516,12 @@
14761516
}
14771517
],
14781518
"title": "No Tools",
1479-
"default": false
1519+
"description": "Whether to bypass all tools and MCP servers",
1520+
"default": false,
1521+
"examples": [
1522+
true,
1523+
false
1524+
]
14801525
},
14811526
"media_type": {
14821527
"anyOf": [
@@ -1487,7 +1532,11 @@
14871532
"type": "null"
14881533
}
14891534
],
1490-
"title": "Media Type"
1535+
"title": "Media Type",
1536+
"description": "Media type (used just to enable compatibility)",
1537+
"examples": [
1538+
"application/json"
1539+
]
14911540
}
14921541
},
14931542
"additionalProperties": false,

docs/openapi.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,14 @@ Example:
737737

738738
| Field | Type | Description |
739739
|-------|------|-------------|
740-
| query | string | |
741-
| conversation_id | | |
742-
| provider | | |
743-
| model | | |
744-
| system_prompt | | |
745-
| attachments | | |
746-
| no_tools | | |
747-
| media_type | | |
740+
| query | string | The query string |
741+
| conversation_id | | The optional conversation ID (UUID) |
742+
| provider | | The optional provider |
743+
| model | | The optional model |
744+
| system_prompt | | The optional system prompt. |
745+
| attachments | | The optional list of attachments. |
746+
| no_tools | | Whether to bypass all tools and MCP servers |
747+
| media_type | | Media type (used just to enable compatibility) |
748748

749749

750750
## QueryResponse

docs/output.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,14 +719,14 @@ Example:
719719

720720
| Field | Type | Description |
721721
|-------|------|-------------|
722-
| query | string | |
723-
| conversation_id | | |
724-
| provider | | |
725-
| model | | |
726-
| system_prompt | | |
727-
| attachments | | |
728-
| no_tools | | |
729-
| media_type | | |
722+
| query | string | The query string |
723+
| conversation_id | | The optional conversation ID (UUID) |
724+
| provider | | The optional provider |
725+
| model | | The optional model |
726+
| system_prompt | | The optional system prompt. |
727+
| attachments | | The optional list of attachments. |
728+
| no_tools | | Whether to bypass all tools and MCP servers |
729+
| media_type | | Media type (used just to enable compatibility) |
730730

731731

732732
## QueryResponse

src/models/requests.py

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,70 @@ class QueryRequest(BaseModel):
8585
```
8686
"""
8787

88-
query: str
89-
conversation_id: Optional[str] = None
90-
provider: Optional[str] = None
91-
model: Optional[str] = None
92-
system_prompt: Optional[str] = None
93-
attachments: Optional[list[Attachment]] = None
94-
no_tools: Optional[bool] = False
88+
query: str = Field(
89+
description="The query string",
90+
examples=["What is Kubernetes?"],
91+
)
92+
93+
conversation_id: Optional[str] = Field(
94+
None,
95+
description="The optional conversation ID (UUID)",
96+
examples=["c5260aec-4d82-4370-9fdf-05cf908b3f16"],
97+
)
98+
99+
provider: Optional[str] = Field(
100+
None,
101+
description="The optional provider",
102+
examples=["openai", "watsonx"],
103+
)
104+
105+
model: Optional[str] = Field(
106+
None,
107+
description="The optional model",
108+
examples=["gpt4mini"],
109+
)
110+
111+
system_prompt: Optional[str] = Field(
112+
None,
113+
description="The optional system prompt.",
114+
examples=["You are OpenShift assistant.", "You are Ansible assistant."],
115+
)
116+
117+
attachments: Optional[list[Attachment]] = Field(
118+
None,
119+
description="The optional list of attachments.",
120+
examples=[
121+
{
122+
"attachment_type": "log",
123+
"content_type": "text/plain",
124+
"content": "this is attachment",
125+
},
126+
{
127+
"attachment_type": "configuration",
128+
"content_type": "application/yaml",
129+
"content": "kind: Pod\n metadata:\n name: private-reg",
130+
},
131+
{
132+
"attachment_type": "configuration",
133+
"content_type": "application/yaml",
134+
"content": "foo: bar",
135+
},
136+
],
137+
)
138+
139+
no_tools: Optional[bool] = Field(
140+
False,
141+
description="Whether to bypass all tools and MCP servers",
142+
examples=[True, False],
143+
)
144+
95145
# media_type is not used in 'lightspeed-stack' that only supports application/json.
96146
# the field is kept here to enable compatibility with 'road-core' clients.
97-
media_type: Optional[str] = None
147+
media_type: Optional[str] = Field(
148+
None,
149+
description="Media type (used just to enable compatibility)",
150+
examples=["application/json"],
151+
)
98152

99153
# provides examples for /docs endpoint
100154
model_config = {

0 commit comments

Comments
 (0)