You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openai-client/src/test/scala/io/cequence/openaiscala/JsonFormatsSpec.scala
+101-2Lines changed: 101 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,52 @@ class JsonFormatsSpec extends AnyWordSpecLike with Matchers {
122
122
| } ]
123
123
|}""".stripMargin
124
124
125
+
privatevalThreadMessageContentJson=
126
+
"""{
127
+
| "type": "text",
128
+
| "text": {
129
+
| "value": "Based on the conference program you provided, here are some talks that align with your goal of digitising and optimizing procurement processes with the use of AI:\n\n1. **\"AI AS A TOOL OR A TOY?\"** \n - Description: This session covers the basics of AI in the context of corporate procurement, successful case studies, AI tools for procurement managers, integrating AI into existing systems, and measuring success.\n - Speaker: Not specified\n - Time: 9:50-10:30, Stage 6 Chat GPT and Other AI in Procurement\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\n2. **\"HOW TO 'TALK' TO AI FOR BETTER PROCUREMENT DECISIONS\"** \n - Description: Focuses on formulating prompts for effective interaction with AI, adapting AI to enterprise processes, overcoming communication challenges, and includes interactive demonstrations.\n - Speaker: Not specified\n - Time: 10:30-11:10, Stage 6 Chat GPT and Other AI in Procurement\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\n3. **\"WHAT AI DOESN'T SAY / HOW IT AFFECTS CORPORATE PROCUREMENT ERRORS & BIASES IN AI: RECOGNISING & MINIMISING RISKS\"** \n - Description: Covers understanding AI decision-making processes, legal and ethical aspects, risk mitigation strategies, and DeepFake attacks.\n - Speaker: Not specified\n - Time: 11:30-12:10, Stage 6 Chat GPT and Other AI in Procurement\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\n4. **\"FUTURE OF PROCUREMENT ECHOES\"** \n - Description: Explores the application of AI in contract management and workflow to simplify procurement processes.\n - Speakers: Rasťo Kovaľ – Cequence, Jana Dubcová – CNPK\n - Time: 14:30-15:30, Stage 7 The Digital Revolution in Procurement Practice\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\nAttending these talks can provide valuable insights into leveraging AI for digital transformation and optimization of procurement processes.",
130
+
| "annotations": [
131
+
| {
132
+
| "type": "file_citation",
133
+
| "text": "【4:0†source】",
134
+
| "start_index": 555,
135
+
| "end_index": 567,
136
+
| "file_citation": {
137
+
| "file_id": "file-gGBbjfqasohuF31BhkIpmTZk"
138
+
| }
139
+
| },
140
+
| {
141
+
| "type": "file_citation",
142
+
| "text": "【4:0†source】",
143
+
| "start_index": 973,
144
+
| "end_index": 985,
145
+
| "file_citation": {
146
+
| "file_id": "file-gGBbjfqasohuF31BhkIpmTZk"
147
+
| }
148
+
| },
149
+
| {
150
+
| "type": "file_citation",
151
+
| "text": "【4:0†source】",
152
+
| "start_index": 1398,
153
+
| "end_index": 1410,
154
+
| "file_citation": {
155
+
| "file_id": "file-gGBbjfqasohuF31BhkIpmTZk"
156
+
| }
157
+
| },
158
+
| {
159
+
| "type": "file_citation",
160
+
| "text": "【4:0†source】",
161
+
| "start_index": 1754,
162
+
| "end_index": 1766,
163
+
| "file_citation": {
164
+
| "file_id": "file-gGBbjfqasohuF31BhkIpmTZk"
165
+
| }
166
+
| }
167
+
| ]
168
+
| }
169
+
|}""".stripMargin
170
+
125
171
"JSON Formats" should {
126
172
127
173
"serialize and deserialize a String response format" in {
@@ -321,12 +367,64 @@ class JsonFormatsSpec extends AnyWordSpecLike with Matchers {
321
367
Pretty
322
368
)
323
369
}
370
+
371
+
"serialize and deserialize ThreadMessageContent" in {
372
+
valthreadMessageContent=
373
+
ThreadMessageContent(
374
+
`type` =ThreadMessageContentType.text,
375
+
text =Some(
376
+
ThreadMessageText(
377
+
value =
378
+
"Based on the conference program you provided, here are some talks that align with your goal of digitising and optimizing procurement processes with the use of AI:\n\n1. **\"AI AS A TOOL OR A TOY?\"** \n - Description: This session covers the basics of AI in the context of corporate procurement, successful case studies, AI tools for procurement managers, integrating AI into existing systems, and measuring success.\n - Speaker: Not specified\n - Time: 9:50-10:30, Stage 6 Chat GPT and Other AI in Procurement\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\n2. **\"HOW TO 'TALK' TO AI FOR BETTER PROCUREMENT DECISIONS\"** \n - Description: Focuses on formulating prompts for effective interaction with AI, adapting AI to enterprise processes, overcoming communication challenges, and includes interactive demonstrations.\n - Speaker: Not specified\n - Time: 10:30-11:10, Stage 6 Chat GPT and Other AI in Procurement\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\n3. **\"WHAT AI DOESN'T SAY / HOW IT AFFECTS CORPORATE PROCUREMENT ERRORS & BIASES IN AI: RECOGNISING & MINIMISING RISKS\"** \n - Description: Covers understanding AI decision-making processes, legal and ethical aspects, risk mitigation strategies, and DeepFake attacks.\n - Speaker: Not specified\n - Time: 11:30-12:10, Stage 6 Chat GPT and Other AI in Procurement\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\n4. **\"FUTURE OF PROCUREMENT ECHOES\"** \n - Description: Explores the application of AI in contract management and workflow to simplify procurement processes.\n - Speakers: Rasťo Kovaľ – Cequence, Jana Dubcová – CNPK\n - Time: 14:30-15:30, Stage 7 The Digital Revolution in Procurement Practice\n - Source: `file-gGBbjfqasohuF31BhkIpmTZk`【4:0†source】\n\nAttending these talks can provide valuable insights into leveraging AI for digital transformation and optimization of procurement processes.",
0 commit comments