-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Blocker - P1
-
Affects Version/s: None
-
Component/s: None
-
Atlas Streams
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
As a follow on to https://jira.mongodb.org/browse/SERVER-101258, we need to be able to handle arrays in the results, for example the OpenAI API returns an array called choices.
How we might call the stage:
$https: {
connectionName: "AzureChatGPT",
method: "POST",
as: "apiResults",
// this means deserialize all json strings found in the response.
config: { parseJsonStrings: true },
payload: [
{
$project: {
_id: 0,
model: "gpt-4o-mini",
response_format: { type: "json_object" },
messages: [
....
example Data from API
{
...,
choices: [
{
...
message: {
content: '{"sentiment_score":0,"reasoning":"The conversation discusses various databases, including MongoDB and Oracle, but does not have a strong positive or negative sentiment overall. It reflects a neutral stance on the potential adoption of new technologies and their integration challenges.","orig_language":"English","streaming_score":0}',
}
},
{
...
message: {
content: '{"sentiment_score":0,"reasoning":"The conversation discusses various databases, including MongoDB and Oracle, but does not have a strong positive or negative sentiment overall. It reflects a neutral stance on the potential adoption of new technologies and their integration challenges.","orig_language":"English","streaming_score":0}',
}
}
],
- is duplicated by
-
SERVER-102182 Ensure https tests have supported curl version
-
- Closed
-
- is related to
-
SERVER-101258 Facility to de-serialize strings in the $http operator
-
- Closed
-
-
SERVER-102047 Streams: Fix failing https_local.js test
-
- Closed
-