Skip to content

Commit 3781da6

Browse files
committed
Adding endpoint for chat communication
Adding API endpoint to allow communication with AI Agent about license reports
1 parent 34ddd5d commit 3781da6

File tree

3 files changed

+192
-4
lines changed

3 files changed

+192
-4
lines changed

specs/Data-Gateway.json

Lines changed: 189 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,99 @@
151151
"title": "Core System - Health Report",
152152
"type": "object"
153153
},
154+
"Chat.MessageRecord": {
155+
"title": "Chat - Message Record",
156+
"description": "Object representing entity supplied to the AI agent or a response from the AI Agent",
157+
"example": {
158+
"role": "assistant",
159+
"content": "What are the available IDs?",
160+
"tool_calls": [
161+
{
162+
"id": "call_abc123",
163+
"type": "function",
164+
"function": {
165+
"arguments": "",
166+
"name": "getCorrelationIDs"
167+
}
168+
}
169+
]
170+
},
171+
"type": "object",
172+
"properties": {
173+
"content": {
174+
"oneOf": [
175+
{
176+
"type": "string",
177+
"description": "The contents of the message"
178+
},
179+
{
180+
"type": "array",
181+
"description": "The contents of the message",
182+
"items": {
183+
"type": "object",
184+
"properties": {
185+
"text": {
186+
"type": "string",
187+
"description": "The text content"
188+
},
189+
"type": {
190+
"type": "string",
191+
"description": "The type of the content part"
192+
}
193+
}
194+
}
195+
}
196+
]
197+
},
198+
"role": {
199+
"type": "string",
200+
"description": "The role of the messages author"
201+
},
202+
"name": {
203+
"type": "string",
204+
"description": "An optional name for the participant"
205+
},
206+
"tool_calls": {
207+
"type": "array",
208+
"description": "The tool calls generated by the model, such as function calls",
209+
"items": {
210+
"type": "object",
211+
"properties": {
212+
"id": {
213+
"type": "string",
214+
"description": "The ID of the tool call"
215+
},
216+
"function": {
217+
"type": "object",
218+
"description": "The function that the model called",
219+
"properties": {
220+
"arguments": {
221+
"type": "string",
222+
"description": "The arguments to call the function with"
223+
},
224+
"name": {
225+
"type": "string",
226+
"description": "The name of the function to call"
227+
}
228+
}
229+
},
230+
"type": {
231+
"type": "string",
232+
"description": "The type of the tool. Currently, only `function` is supported"
233+
}
234+
}
235+
}
236+
},
237+
"tool_call_id": {
238+
"type": "string",
239+
"description": "Tool call that this message is responding to"
240+
}
241+
},
242+
"required": [
243+
"content",
244+
"role"
245+
]
246+
},
154247
"LicenseReport.CorrelationRecord": {
155248
"description": "Metadata that describes the execution session (run) that is used to tie/relate all of the license report together.",
156249
"example": {
@@ -913,7 +1006,7 @@
9131006
},
9141007
"description": "Collects data from the various SHI Lab products and makes it available in a standardized way.",
9151008
"title": "SHI Data Gateway",
916-
"version": "2.1.2"
1009+
"version": "2.1.3"
9171010
},
9181011
"openapi": "3.0.0",
9191012
"paths": {
@@ -1475,6 +1568,97 @@
14751568
"summary": "Delete the Specified License Report for Specified Tenant"
14761569
}
14771570
},
1571+
"/Api/Chat/LicenseGpt": {
1572+
"post": {
1573+
"summary": "Inquire License Data from AI Agent",
1574+
"description": "Enables a conversation mode with AI agent to request details of the available license reports for the tenant.\n\nThis endpoint requires the `LicenseReport.Read.All`, or `LicenseReport.ReadWrite.All` scope (permission). This endpoint is also only accessible from the `SHI` and `SHI Lab` tenants. End user access is restricted.",
1575+
"operationId": "/Api/Chat/LicenseGpt/Post",
1576+
"requestBody": {
1577+
"content": {
1578+
"application/json": {
1579+
"schema": {
1580+
"description": "Collection of conversation parts provided by user to be ingested by the agent",
1581+
"type": "array",
1582+
"items": {
1583+
"$ref": "#/components/schemas/Chat.MessageRecord"
1584+
}
1585+
}
1586+
}
1587+
}
1588+
},
1589+
"responses": {
1590+
"200": {
1591+
"content": {
1592+
"application/json": {
1593+
"schema": {
1594+
"example": {
1595+
"messageList": [
1596+
{
1597+
"role": "user",
1598+
"content": "Hello"
1599+
},
1600+
{
1601+
"role": "assistant",
1602+
"content": "Hello, how can I assist you today?"
1603+
},
1604+
{
1605+
"role": "user",
1606+
"content": "Can you show me what correlation records I have?"
1607+
},
1608+
{
1609+
"role": "assistant",
1610+
"content": "",
1611+
"tool_calls": [
1612+
{
1613+
"id": "call_abc123",
1614+
"type": "function",
1615+
"function": {
1616+
"arguments": "",
1617+
"name": "getCorrelationIDs"
1618+
}
1619+
}
1620+
]
1621+
},
1622+
{
1623+
"role": "tool",
1624+
"content": "{'825a9d7e-0b62-4392-b8ef-ab6951a46ebd':'2025-07-03T18:39:50.828Z','744c0878-3a82-48a7-b239-a1d4b9298a69':'2025-07-07T21:01:20.995Z'}",
1625+
"tool_call_id": "call_abc123"
1626+
},
1627+
{
1628+
"role": "assistant",
1629+
"content": "You have correlation records for the following dates:\n- July 3, 2025\n- July 7, 2025\n\nWould you like to see details from any of these correlation records?"
1630+
}
1631+
],
1632+
"responseText": "You have correlation records for the following dates:\n- July 3, 2025\n- July 7, 2025\n\nWould you like to see details from any of these correlation records?"
1633+
},
1634+
"type": "object",
1635+
"properties": {
1636+
"responseText": {
1637+
"type": "string",
1638+
"description": "Most recent response text"
1639+
},
1640+
"messageList": {
1641+
"type": "array",
1642+
"description": "List of message objects in current conversation",
1643+
"items": {
1644+
"$ref": "#/components/schemas/Chat.MessageRecord"
1645+
}
1646+
}
1647+
}
1648+
}
1649+
}
1650+
},
1651+
"description": "OK"
1652+
},
1653+
"400": {
1654+
"$ref": "#/components/responses/400"
1655+
}
1656+
},
1657+
"tags": [
1658+
"Chat"
1659+
]
1660+
}
1661+
},
14781662
"/Api/Entitlement/Shield": {
14791663
"post": {
14801664
"description": "Creates a new license entitlement (activation) for SHIELD.\n\nThis endpoint requires the `LicenseEntitlement.ReadWrite.All` scope (permission). This endpoint is also only accessible form the `SHI` and `SHI Lab` tenants. End user access is restricted.",
@@ -3053,6 +3237,10 @@
30533237
{
30543238
"name": "SHIELD - Update",
30553239
"description": "Update Service Configuration for SHIELD."
3240+
},
3241+
{
3242+
"name": "Chat",
3243+
"description": "Enables query for available information (like tenant, license, etc) via conversation with OpenAI agent."
30563244
}
30573245
]
30583246
}

src/dataGateway/TypeScript/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dataGateway/TypeScript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shi-corp/sdk-data-gateway",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"type": "module",
55
"main": "bin/index.js",
66
"description": "SDK client used to interface with the SHI Data Gateway service.",

0 commit comments

Comments
 (0)