Skip to content

Commit f04c5d5

Browse files
committed
Fixtures
1 parent 54bdd62 commit f04c5d5

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

kotlin-wot-integration-wot-agent/src/main/helm/templates/service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ spec:
1111
targetPort: {{ .Values.service.port }}
1212
protocol: TCP
1313
name: http
14+
- name: http-cap
15+
port: 8181
16+
protocol: TCP
17+
targetPort: 8181
1418
selector:
1519
{{- include "wot-agent.selectorLabels" . | nindent 4 }}

kotlin-wot-integration-wot-agent/src/main/kotlin/integration/ChatAgent.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Component
2020
@Thing(id="chatagent", title="Chat Agent",
2121
description="A chat agent.", type= LMOSThingType.AGENT)
2222
@Context(prefix = LMOSContext.prefix, url = LMOSContext.url)
23+
@Link(href = "http://wot-agent.default.svc.cluster.local:8181/lmos/chatagent/capabilities", rel = "service-meta", type = "application/json")
2324
@VersionInfo(instance = "1.0.0")
2425
@Component
2526
class ChatAgent(agentProvider: AgentProvider, @Property(readOnly = true)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Deutsche Telekom AG and others
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
package integration
8+
9+
import org.springframework.http.MediaType
10+
import org.springframework.http.ResponseEntity
11+
import org.springframework.web.bind.annotation.GetMapping
12+
import org.springframework.web.bind.annotation.RequestMapping
13+
import org.springframework.web.bind.annotation.RestController
14+
15+
@RestController
16+
@RequestMapping("lmos/chatagent", produces = [MediaType.APPLICATION_JSON_VALUE])
17+
class WoTDummyController {
18+
19+
@GetMapping("/capabilities")
20+
fun getCapabilitiesDescription(): ResponseEntity<String> {
21+
return ResponseEntity.ok().body(capabilitiesDescription)
22+
}
23+
24+
private val capabilitiesDescription =
25+
"""
26+
{
27+
"supportedTenants": [
28+
"acme"
29+
],
30+
"supportedChannels": [
31+
"web",
32+
"ivr"
33+
],
34+
"providedCapabilities": [
35+
{
36+
"name": "chat",
37+
"version": "1.0.0",
38+
"description": "Capability to chat"
39+
},
40+
{
41+
"name": "ask-question",
42+
"version": "1.0.0",
43+
"description": "Capability to ask questions"
44+
}
45+
]
46+
}
47+
48+
""".trimIndent()
49+
}

kotlin-wot-integration-wot-agent/src/main/resources/application.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ arc:
77
client: azure
88
url: https://gpt4-uk.openai.azure.com
99

10+
server:
11+
port: 8181
12+
1013
wot:
1114
servient:
1215
websocket:
1316
server:
14-
enabled: true
17+
enabled: false
1518
host: localhost
1619
port: 8080
1720
http:
1821
server:
19-
enabled: false
22+
enabled: true
2023
host: localhost
2124
port: 8080
2225
mqtt:

0 commit comments

Comments
 (0)