@sap-ai-sdk/orchestration 1.8.1-20250219013121.0 → 1.8.1-20250221013114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -142,8 +142,34 @@ You can use the following convenience methods for handling chat completion respo
|
|
|
142
142
|
|
|
143
143
|
#### Structured Outputs
|
|
144
144
|
|
|
145
|
+
##### Tool Calling
|
|
146
|
+
|
|
147
|
+
Structured outputs through tools can be enabled by setting `strict: true` in the function definition.
|
|
148
|
+
These tools enable the creation of multi-step, agent-driven workflows, allowing LLMs to perform specific actions.
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
templating: {
|
|
152
|
+
tools: [
|
|
153
|
+
type: 'function',
|
|
154
|
+
function: {
|
|
155
|
+
name: 'add',
|
|
156
|
+
description: 'Calculate the absolute value of x',
|
|
157
|
+
parameters: {
|
|
158
|
+
type: 'object',
|
|
159
|
+
properties: {
|
|
160
|
+
x: { type: number }
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
required: ['x'],
|
|
164
|
+
additionalProperties: false
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
##### Using `response_format` parameter
|
|
170
|
+
|
|
145
171
|
Setting `response_format` under `templating` guarantees that the model's output aligns with the schema type specified by developers.
|
|
146
|
-
It is useful when the model is not calling a tool
|
|
172
|
+
It is useful when the model is **not calling a tool**, but rather, responding to the user in a structured way.
|
|
147
173
|
|
|
148
174
|
The example below demonstrates how to use `response_format` to return a JSON Schema, with `strict: true` ensuring the outputs conform precisely to the schema.
|
|
149
175
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ai-sdk/orchestration",
|
|
3
|
-
"version": "1.8.1-
|
|
3
|
+
"version": "1.8.1-20250221013114.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@sap-cloud-sdk/util": "^3.26.1",
|
|
24
|
-
"@sap-ai-sdk/core": "^1.8.1-
|
|
25
|
-
"@sap-ai-sdk/ai-api": "^1.8.1-
|
|
24
|
+
"@sap-ai-sdk/core": "^1.8.1-20250221013114.0",
|
|
25
|
+
"@sap-ai-sdk/ai-api": "^1.8.1-20250221013114.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@sap-cloud-sdk/http-client": "^3.26.1",
|