llama-stack-client 0.6.1 → 0.7.1
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/.github/workflows/ci.yml +16 -10
- package/.gitignore +1 -0
- package/.release-please-manifest.json +1 -1
- package/.stats.yml +4 -4
- package/CHANGELOG.md +80 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +22 -0
- package/api.md +1 -71
- package/dist/CHANGELOG.md +80 -0
- package/dist/README.md +22 -0
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +8 -17
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +8 -17
- package/dist/core.mjs.map +1 -1
- package/dist/index.d.mts +51 -12
- package/dist/index.d.ts +51 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -11
- package/dist/index.mjs.map +1 -1
- package/dist/internal/utils/query.d.ts +2 -0
- package/dist/internal/utils/query.d.ts.map +1 -0
- package/dist/{resources/alpha/post-training/post-training.js → internal/utils/query.js} +6 -24
- package/dist/internal/utils/query.js.map +1 -0
- package/dist/{resources/alpha/post-training.mjs → internal/utils/query.mjs} +5 -2
- package/dist/internal/utils/query.mjs.map +1 -0
- package/dist/package.json +1 -1
- package/dist/resources/alpha/alpha.d.ts +0 -4
- package/dist/resources/alpha/alpha.d.ts.map +1 -1
- package/dist/resources/alpha/alpha.js +0 -4
- package/dist/resources/alpha/alpha.js.map +1 -1
- package/dist/resources/alpha/alpha.mjs +0 -4
- package/dist/resources/alpha/alpha.mjs.map +1 -1
- package/dist/resources/alpha/eval/eval.d.ts +3 -0
- package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.js +3 -0
- package/dist/resources/alpha/eval/eval.js.map +1 -1
- package/dist/resources/alpha/eval/eval.mjs +3 -0
- package/dist/resources/alpha/eval/eval.mjs.map +1 -1
- package/dist/resources/alpha/eval/jobs.d.ts +3 -0
- package/dist/resources/alpha/eval/jobs.d.ts.map +1 -1
- package/dist/resources/alpha/eval/jobs.js +3 -0
- package/dist/resources/alpha/eval/jobs.js.map +1 -1
- package/dist/resources/alpha/eval/jobs.mjs +3 -0
- package/dist/resources/alpha/eval/jobs.mjs.map +1 -1
- package/dist/resources/alpha/index.d.ts +0 -1
- package/dist/resources/alpha/index.d.ts.map +1 -1
- package/dist/resources/alpha/index.js +1 -3
- package/dist/resources/alpha/index.js.map +1 -1
- package/dist/resources/alpha/index.mjs +0 -1
- package/dist/resources/alpha/index.mjs.map +1 -1
- package/dist/resources/alpha/inference.d.ts +8 -0
- package/dist/resources/alpha/inference.d.ts.map +1 -1
- package/dist/resources/alpha/inference.js +8 -0
- package/dist/resources/alpha/inference.js.map +1 -1
- package/dist/resources/alpha/inference.mjs +8 -0
- package/dist/resources/alpha/inference.mjs.map +1 -1
- package/dist/resources/batches.d.ts +8 -0
- package/dist/resources/batches.d.ts.map +1 -1
- package/dist/resources/batches.js +8 -0
- package/dist/resources/batches.js.map +1 -1
- package/dist/resources/batches.mjs +8 -0
- package/dist/resources/batches.mjs.map +1 -1
- package/dist/resources/beta/datasets.d.ts +4 -8
- package/dist/resources/beta/datasets.d.ts.map +1 -1
- package/dist/resources/chat/chat.d.ts +34 -32
- package/dist/resources/chat/chat.d.ts.map +1 -1
- package/dist/resources/chat/chat.js.map +1 -1
- package/dist/resources/chat/chat.mjs.map +1 -1
- package/dist/resources/chat/completions.d.ts +321 -713
- package/dist/resources/chat/completions.d.ts.map +1 -1
- package/dist/resources/chat/completions.js +8 -0
- package/dist/resources/chat/completions.js.map +1 -1
- package/dist/resources/chat/completions.mjs +8 -0
- package/dist/resources/chat/completions.mjs.map +1 -1
- package/dist/resources/completions.d.ts +10 -4
- package/dist/resources/completions.d.ts.map +1 -1
- package/dist/resources/completions.js +8 -0
- package/dist/resources/completions.js.map +1 -1
- package/dist/resources/completions.mjs +8 -0
- package/dist/resources/completions.mjs.map +1 -1
- package/dist/resources/conversations/conversations.d.ts +95 -2
- package/dist/resources/conversations/conversations.d.ts.map +1 -1
- package/dist/resources/conversations/conversations.js +3 -0
- package/dist/resources/conversations/conversations.js.map +1 -1
- package/dist/resources/conversations/conversations.mjs +3 -0
- package/dist/resources/conversations/conversations.mjs.map +1 -1
- package/dist/resources/conversations/items.d.ts +371 -8
- package/dist/resources/conversations/items.d.ts.map +1 -1
- package/dist/resources/conversations/items.js +3 -0
- package/dist/resources/conversations/items.js.map +1 -1
- package/dist/resources/conversations/items.mjs +3 -0
- package/dist/resources/conversations/items.mjs.map +1 -1
- package/dist/resources/embeddings.d.ts +8 -0
- package/dist/resources/embeddings.d.ts.map +1 -1
- package/dist/resources/embeddings.js +8 -0
- package/dist/resources/embeddings.js.map +1 -1
- package/dist/resources/embeddings.mjs +8 -0
- package/dist/resources/embeddings.mjs.map +1 -1
- package/dist/resources/files.d.ts +11 -8
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +3 -0
- package/dist/resources/files.js.map +1 -1
- package/dist/resources/files.mjs +3 -0
- package/dist/resources/files.mjs.map +1 -1
- package/dist/resources/index.d.ts +1 -4
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -7
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs +0 -3
- package/dist/resources/index.mjs.map +1 -1
- package/dist/resources/inspect.d.ts +3 -0
- package/dist/resources/inspect.d.ts.map +1 -1
- package/dist/resources/inspect.js +3 -0
- package/dist/resources/inspect.js.map +1 -1
- package/dist/resources/inspect.mjs +3 -0
- package/dist/resources/inspect.mjs.map +1 -1
- package/dist/resources/models/index.d.ts +1 -1
- package/dist/resources/models/index.d.ts.map +1 -1
- package/dist/resources/models/index.js.map +1 -1
- package/dist/resources/models/index.mjs.map +1 -1
- package/dist/resources/models/models.d.ts +7 -65
- package/dist/resources/models/models.d.ts.map +1 -1
- package/dist/resources/models/models.js +0 -19
- package/dist/resources/models/models.js.map +1 -1
- package/dist/resources/models/models.mjs +0 -19
- package/dist/resources/models/models.mjs.map +1 -1
- package/dist/resources/moderations.d.ts +3 -0
- package/dist/resources/moderations.d.ts.map +1 -1
- package/dist/resources/moderations.js +3 -0
- package/dist/resources/moderations.js.map +1 -1
- package/dist/resources/moderations.mjs +3 -0
- package/dist/resources/moderations.mjs.map +1 -1
- package/dist/resources/prompts/prompts.d.ts +3 -0
- package/dist/resources/prompts/prompts.d.ts.map +1 -1
- package/dist/resources/prompts/prompts.js +3 -0
- package/dist/resources/prompts/prompts.js.map +1 -1
- package/dist/resources/prompts/prompts.mjs +3 -0
- package/dist/resources/prompts/prompts.mjs.map +1 -1
- package/dist/resources/prompts/versions.d.ts +3 -0
- package/dist/resources/prompts/versions.d.ts.map +1 -1
- package/dist/resources/prompts/versions.js +3 -0
- package/dist/resources/prompts/versions.js.map +1 -1
- package/dist/resources/prompts/versions.mjs +3 -0
- package/dist/resources/prompts/versions.mjs.map +1 -1
- package/dist/resources/providers.d.ts +3 -0
- package/dist/resources/providers.d.ts.map +1 -1
- package/dist/resources/providers.js +3 -0
- package/dist/resources/providers.js.map +1 -1
- package/dist/resources/providers.mjs +3 -0
- package/dist/resources/providers.mjs.map +1 -1
- package/dist/resources/responses/input-items.d.ts +102 -3
- package/dist/resources/responses/input-items.d.ts.map +1 -1
- package/dist/resources/responses/responses.d.ts +582 -11
- package/dist/resources/responses/responses.d.ts.map +1 -1
- package/dist/resources/responses/responses.js.map +1 -1
- package/dist/resources/responses/responses.mjs.map +1 -1
- package/dist/resources/routes.d.ts +3 -0
- package/dist/resources/routes.d.ts.map +1 -1
- package/dist/resources/routes.js +3 -0
- package/dist/resources/routes.js.map +1 -1
- package/dist/resources/routes.mjs +3 -0
- package/dist/resources/routes.mjs.map +1 -1
- package/dist/resources/safety.d.ts +14 -11
- package/dist/resources/safety.d.ts.map +1 -1
- package/dist/resources/safety.js +3 -0
- package/dist/resources/safety.js.map +1 -1
- package/dist/resources/safety.mjs +3 -0
- package/dist/resources/safety.mjs.map +1 -1
- package/dist/resources/vector-io.d.ts +4 -4
- package/dist/resources/vector-stores/file-batches.d.ts +49 -1
- package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
- package/dist/resources/vector-stores/file-batches.js.map +1 -1
- package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
- package/dist/resources/vector-stores/files.d.ts +100 -4
- package/dist/resources/vector-stores/files.d.ts.map +1 -1
- package/dist/resources/vector-stores/files.js.map +1 -1
- package/dist/resources/vector-stores/files.mjs.map +1 -1
- package/dist/resources/vector-stores/vector-stores.d.ts +51 -3
- package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/dist/resources/vector-stores/vector-stores.js.map +1 -1
- package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/dist/src/core.ts +10 -21
- package/dist/src/index.ts +51 -48
- package/{src/resources/alpha/post-training.ts → dist/src/internal/utils/query.ts} +5 -1
- package/dist/src/resources/alpha/alpha.ts +0 -20
- package/dist/src/resources/alpha/eval/eval.ts +3 -0
- package/dist/src/resources/alpha/eval/jobs.ts +3 -0
- package/dist/src/resources/alpha/index.ts +0 -8
- package/dist/src/resources/alpha/inference.ts +8 -0
- package/dist/src/resources/batches.ts +8 -0
- package/dist/src/resources/beta/datasets.ts +4 -9
- package/dist/src/resources/chat/chat.ts +36 -33
- package/dist/src/resources/chat/completions.ts +307 -811
- package/dist/src/resources/completions.ts +10 -4
- package/dist/src/resources/conversations/conversations.ts +121 -1
- package/dist/src/resources/conversations/items.ts +477 -6
- package/dist/src/resources/embeddings.ts +8 -0
- package/dist/src/resources/files.ts +12 -9
- package/dist/src/resources/index.ts +0 -18
- package/dist/src/resources/inspect.ts +3 -0
- package/dist/src/resources/models/index.ts +0 -2
- package/dist/src/resources/models/models.ts +7 -82
- package/dist/src/resources/moderations.ts +3 -0
- package/dist/src/resources/prompts/prompts.ts +3 -0
- package/dist/src/resources/prompts/versions.ts +3 -0
- package/dist/src/resources/providers.ts +3 -0
- package/dist/src/resources/responses/input-items.ts +128 -2
- package/dist/src/resources/responses/responses.ts +706 -7
- package/dist/src/resources/routes.ts +3 -0
- package/dist/src/resources/safety.ts +15 -12
- package/dist/src/resources/vector-io.ts +4 -4
- package/dist/src/resources/vector-stores/file-batches.ts +57 -0
- package/dist/src/resources/vector-stores/files.ts +117 -3
- package/dist/src/resources/vector-stores/vector-stores.ts +59 -2
- package/dist/src/streaming.ts +24 -6
- package/dist/src/version.ts +1 -1
- package/dist/streaming.d.ts.map +1 -1
- package/dist/streaming.js +21 -6
- package/dist/streaming.js.map +1 -1
- package/dist/streaming.mjs +21 -6
- package/dist/streaming.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/scripts/mock +21 -10
- package/scripts/test +8 -8
- package/src/core.ts +10 -21
- package/src/index.ts +51 -48
- package/{dist/src/resources/alpha/post-training.ts → src/internal/utils/query.ts} +5 -1
- package/src/resources/alpha/alpha.ts +0 -20
- package/src/resources/alpha/eval/eval.ts +3 -0
- package/src/resources/alpha/eval/jobs.ts +3 -0
- package/src/resources/alpha/index.ts +0 -8
- package/src/resources/alpha/inference.ts +8 -0
- package/src/resources/batches.ts +8 -0
- package/src/resources/beta/datasets.ts +4 -9
- package/src/resources/chat/chat.ts +36 -33
- package/src/resources/chat/completions.ts +307 -811
- package/src/resources/completions.ts +10 -4
- package/src/resources/conversations/conversations.ts +121 -1
- package/src/resources/conversations/items.ts +477 -6
- package/src/resources/embeddings.ts +8 -0
- package/src/resources/files.ts +12 -9
- package/src/resources/index.ts +0 -18
- package/src/resources/inspect.ts +3 -0
- package/src/resources/models/index.ts +0 -2
- package/src/resources/models/models.ts +7 -82
- package/src/resources/moderations.ts +3 -0
- package/src/resources/prompts/prompts.ts +3 -0
- package/src/resources/prompts/versions.ts +3 -0
- package/src/resources/providers.ts +3 -0
- package/src/resources/responses/input-items.ts +128 -2
- package/src/resources/responses/responses.ts +706 -7
- package/src/resources/routes.ts +3 -0
- package/src/resources/safety.ts +15 -12
- package/src/resources/vector-io.ts +4 -4
- package/src/resources/vector-stores/file-batches.ts +57 -0
- package/src/resources/vector-stores/files.ts +117 -3
- package/src/resources/vector-stores/vector-stores.ts +59 -2
- package/src/streaming.ts +24 -6
- package/src/version.ts +1 -1
- package/tests/api-resources/beta/datasets.test.ts +4 -10
- package/tests/api-resources/chat/completions.test.ts +2 -0
- package/tests/api-resources/files.test.ts +2 -2
- package/tests/api-resources/models/models.test.ts +0 -39
- package/tests/api-resources/responses/responses.test.ts +10 -1
- package/tests/api-resources/vector-stores/file-batches.test.ts +1 -1
- package/tests/api-resources/vector-stores/files.test.ts +1 -1
- package/tests/api-resources/vector-stores/vector-stores.test.ts +1 -1
- package/tests/stringifyQuery.test.ts +2 -4
- package/dist/resources/alpha/post-training/index.d.ts +0 -3
- package/dist/resources/alpha/post-training/index.d.ts.map +0 -1
- package/dist/resources/alpha/post-training/index.js +0 -15
- package/dist/resources/alpha/post-training/index.js.map +0 -1
- package/dist/resources/alpha/post-training/index.mjs +0 -10
- package/dist/resources/alpha/post-training/index.mjs.map +0 -1
- package/dist/resources/alpha/post-training/job.d.ts +0 -104
- package/dist/resources/alpha/post-training/job.d.ts.map +0 -1
- package/dist/resources/alpha/post-training/job.js +0 -42
- package/dist/resources/alpha/post-training/job.js.map +0 -1
- package/dist/resources/alpha/post-training/job.mjs +0 -38
- package/dist/resources/alpha/post-training/job.mjs.map +0 -1
- package/dist/resources/alpha/post-training/post-training.d.ts +0 -269
- package/dist/resources/alpha/post-training/post-training.d.ts.map +0 -1
- package/dist/resources/alpha/post-training/post-training.js.map +0 -1
- package/dist/resources/alpha/post-training/post-training.mjs +0 -30
- package/dist/resources/alpha/post-training/post-training.mjs.map +0 -1
- package/dist/resources/alpha/post-training.d.ts +0 -2
- package/dist/resources/alpha/post-training.d.ts.map +0 -1
- package/dist/resources/alpha/post-training.js +0 -25
- package/dist/resources/alpha/post-training.js.map +0 -1
- package/dist/resources/alpha/post-training.mjs.map +0 -1
- package/dist/resources/tool-runtime.d.ts +0 -152
- package/dist/resources/tool-runtime.d.ts.map +0 -1
- package/dist/resources/tool-runtime.js +0 -30
- package/dist/resources/tool-runtime.js.map +0 -1
- package/dist/resources/tool-runtime.mjs +0 -26
- package/dist/resources/tool-runtime.mjs.map +0 -1
- package/dist/resources/toolgroups.d.ts +0 -91
- package/dist/resources/toolgroups.d.ts.map +0 -1
- package/dist/resources/toolgroups.js +0 -54
- package/dist/resources/toolgroups.js.map +0 -1
- package/dist/resources/toolgroups.mjs +0 -50
- package/dist/resources/toolgroups.mjs.map +0 -1
- package/dist/resources/tools.d.ts +0 -26
- package/dist/resources/tools.d.ts.map +0 -1
- package/dist/resources/tools.js +0 -30
- package/dist/resources/tools.js.map +0 -1
- package/dist/resources/tools.mjs +0 -26
- package/dist/resources/tools.mjs.map +0 -1
- package/dist/src/resources/alpha/post-training/index.ts +0 -17
- package/dist/src/resources/alpha/post-training/job.ts +0 -161
- package/dist/src/resources/alpha/post-training/post-training.ts +0 -385
- package/dist/src/resources/tool-runtime.ts +0 -217
- package/dist/src/resources/toolgroups.ts +0 -135
- package/dist/src/resources/tools.ts +0 -52
- package/src/resources/alpha/post-training/index.ts +0 -17
- package/src/resources/alpha/post-training/job.ts +0 -161
- package/src/resources/alpha/post-training/post-training.ts +0 -385
- package/src/resources/tool-runtime.ts +0 -217
- package/src/resources/toolgroups.ts +0 -135
- package/src/resources/tools.ts +0 -52
- package/tests/api-resources/alpha/post-training/job.test.ts +0 -86
- package/tests/api-resources/alpha/post-training/post-training.test.ts +0 -134
- package/tests/api-resources/tool-runtime.test.ts +0 -68
- package/tests/api-resources/toolgroups.test.ts +0 -91
- package/tests/api-resources/tools.test.ts +0 -57
package/dist/version.js
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
// the root directory of this source tree.
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.VERSION = void 0;
|
|
9
|
-
exports.VERSION = '0.
|
|
9
|
+
exports.VERSION = '0.7.1'; // x-release-please-version
|
|
10
10
|
//# sourceMappingURL=version.js.map
|
package/dist/version.mjs
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
//
|
|
4
4
|
// This source code is licensed under the terms described in the LICENSE file in
|
|
5
5
|
// the root directory of this source tree.
|
|
6
|
-
export const VERSION = '0.
|
|
6
|
+
export const VERSION = '0.7.1'; // x-release-please-version
|
|
7
7
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
package/scripts/mock
CHANGED
|
@@ -19,23 +19,34 @@ fi
|
|
|
19
19
|
|
|
20
20
|
echo "==> Starting mock server with URL ${URL}"
|
|
21
21
|
|
|
22
|
-
# Run
|
|
22
|
+
# Run steady mock on the given spec
|
|
23
23
|
if [ "$1" == "--daemon" ]; then
|
|
24
|
-
|
|
24
|
+
# Pre-install the package so the download doesn't eat into the startup timeout
|
|
25
|
+
npm exec --package=@stdy/cli@0.20.2 -- steady --version
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log &
|
|
28
|
+
|
|
29
|
+
# Wait for server to come online via health endpoint (max 30s)
|
|
27
30
|
echo -n "Waiting for server"
|
|
28
|
-
|
|
31
|
+
attempts=0
|
|
32
|
+
while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do
|
|
33
|
+
if ! kill -0 $! 2>/dev/null; then
|
|
34
|
+
echo
|
|
35
|
+
cat .stdy.log
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
attempts=$((attempts + 1))
|
|
39
|
+
if [ "$attempts" -ge 300 ]; then
|
|
40
|
+
echo
|
|
41
|
+
echo "Timed out waiting for Steady server to start"
|
|
42
|
+
cat .stdy.log
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
29
45
|
echo -n "."
|
|
30
46
|
sleep 0.1
|
|
31
47
|
done
|
|
32
48
|
|
|
33
|
-
if grep -q "✖ fatal" ".prism.log"; then
|
|
34
|
-
cat .prism.log
|
|
35
|
-
exit 1
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
49
|
echo
|
|
39
50
|
else
|
|
40
|
-
npm exec --package=@
|
|
51
|
+
npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL"
|
|
41
52
|
fi
|
package/scripts/test
CHANGED
|
@@ -9,8 +9,8 @@ GREEN='\033[0;32m'
|
|
|
9
9
|
YELLOW='\033[0;33m'
|
|
10
10
|
NC='\033[0m' # No Color
|
|
11
11
|
|
|
12
|
-
function
|
|
13
|
-
curl --silent "http://
|
|
12
|
+
function steady_is_running() {
|
|
13
|
+
curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
kill_server_on_port() {
|
|
@@ -25,7 +25,7 @@ function is_overriding_api_base_url() {
|
|
|
25
25
|
[ -n "$TEST_API_BASE_URL" ]
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
if ! is_overriding_api_base_url && !
|
|
28
|
+
if ! is_overriding_api_base_url && ! steady_is_running ; then
|
|
29
29
|
# When we exit this script, make sure to kill the background mock server process
|
|
30
30
|
trap 'kill_server_on_port 4010' EXIT
|
|
31
31
|
|
|
@@ -36,19 +36,19 @@ fi
|
|
|
36
36
|
if is_overriding_api_base_url ; then
|
|
37
37
|
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
|
|
38
38
|
echo
|
|
39
|
-
elif !
|
|
40
|
-
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock
|
|
39
|
+
elif ! steady_is_running ; then
|
|
40
|
+
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server"
|
|
41
41
|
echo -e "running against your OpenAPI spec."
|
|
42
42
|
echo
|
|
43
43
|
echo -e "To run the server, pass in the path or url of your OpenAPI"
|
|
44
|
-
echo -e "spec to the
|
|
44
|
+
echo -e "spec to the steady command:"
|
|
45
45
|
echo
|
|
46
|
-
echo -e " \$ ${YELLOW}npm exec --package=@
|
|
46
|
+
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}"
|
|
47
47
|
echo
|
|
48
48
|
|
|
49
49
|
exit 1
|
|
50
50
|
else
|
|
51
|
-
echo -e "${GREEN}✔ Mock
|
|
51
|
+
echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}"
|
|
52
52
|
echo
|
|
53
53
|
fi
|
|
54
54
|
|
package/src/core.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
APIConnectionTimeoutError,
|
|
14
14
|
APIUserAbortError,
|
|
15
15
|
} from './error';
|
|
16
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
16
17
|
import {
|
|
17
18
|
kind as shimsKind,
|
|
18
19
|
type Readable,
|
|
@@ -543,32 +544,20 @@ export abstract class APIClient {
|
|
|
543
544
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
544
545
|
|
|
545
546
|
const defaultQuery = this.defaultQuery();
|
|
546
|
-
|
|
547
|
-
|
|
547
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
548
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
549
|
+
query = { ...pathQuery, ...defaultQuery, ...query } as Req;
|
|
548
550
|
}
|
|
549
551
|
|
|
550
552
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
551
|
-
url.search = this.stringifyQuery(query
|
|
553
|
+
url.search = this.stringifyQuery(query);
|
|
552
554
|
}
|
|
553
555
|
|
|
554
556
|
return url.toString();
|
|
555
557
|
}
|
|
556
558
|
|
|
557
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
558
|
-
return
|
|
559
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
560
|
-
.map(([key, value]) => {
|
|
561
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
562
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
563
|
-
}
|
|
564
|
-
if (value === null) {
|
|
565
|
-
return `${encodeURIComponent(key)}=`;
|
|
566
|
-
}
|
|
567
|
-
throw new LlamaStackClientError(
|
|
568
|
-
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
569
|
-
);
|
|
570
|
-
})
|
|
571
|
-
.join('&');
|
|
559
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
560
|
+
return stringifyQuery(query);
|
|
572
561
|
}
|
|
573
562
|
|
|
574
563
|
async fetchWithTimeout(
|
|
@@ -650,9 +639,9 @@ export abstract class APIClient {
|
|
|
650
639
|
}
|
|
651
640
|
}
|
|
652
641
|
|
|
653
|
-
// If the API asks us to wait a certain amount of time
|
|
654
|
-
//
|
|
655
|
-
if (
|
|
642
|
+
// If the API asks us to wait a certain amount of time, do what it says.
|
|
643
|
+
// Otherwise calculate a default.
|
|
644
|
+
if (timeoutMillis === undefined) {
|
|
656
645
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
657
646
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
658
647
|
}
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
9
9
|
|
|
10
10
|
import { type Agent } from './_shims/index';
|
|
11
|
-
import
|
|
11
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
12
12
|
import * as Core from './core';
|
|
13
13
|
import * as Errors from './error';
|
|
14
14
|
import * as Pagination from './pagination';
|
|
@@ -75,22 +75,6 @@ import {
|
|
|
75
75
|
ShieldRegisterParams,
|
|
76
76
|
Shields,
|
|
77
77
|
} from './resources/shields';
|
|
78
|
-
import {
|
|
79
|
-
ToolDef,
|
|
80
|
-
ToolInvocationResult,
|
|
81
|
-
ToolRuntime,
|
|
82
|
-
ToolRuntimeInvokeToolParams,
|
|
83
|
-
ToolRuntimeListToolsParams,
|
|
84
|
-
ToolRuntimeListToolsResponse,
|
|
85
|
-
} from './resources/tool-runtime';
|
|
86
|
-
import {
|
|
87
|
-
ListToolGroupsResponse,
|
|
88
|
-
ToolGroup,
|
|
89
|
-
ToolgroupListResponse,
|
|
90
|
-
ToolgroupRegisterParams,
|
|
91
|
-
Toolgroups,
|
|
92
|
-
} from './resources/toolgroups';
|
|
93
|
-
import { ToolListParams, ToolListResponse, Tools } from './resources/tools';
|
|
94
78
|
import {
|
|
95
79
|
QueryChunksResponse,
|
|
96
80
|
VectorIo,
|
|
@@ -111,8 +95,6 @@ import {
|
|
|
111
95
|
ListModelsResponse,
|
|
112
96
|
Model,
|
|
113
97
|
ModelListResponse,
|
|
114
|
-
ModelRegisterParams,
|
|
115
|
-
ModelRegisterResponse,
|
|
116
98
|
ModelRetrieveResponse,
|
|
117
99
|
Models,
|
|
118
100
|
} from './resources/models/models';
|
|
@@ -261,27 +243,72 @@ export class LlamaStackClient extends Core.APIClient {
|
|
|
261
243
|
this.apiKey = apiKey;
|
|
262
244
|
}
|
|
263
245
|
|
|
264
|
-
toolgroups: API.Toolgroups = new API.Toolgroups(this);
|
|
265
|
-
tools: API.Tools = new API.Tools(this);
|
|
266
|
-
toolRuntime: API.ToolRuntime = new API.ToolRuntime(this);
|
|
267
246
|
responses: API.Responses = new API.Responses(this);
|
|
247
|
+
/**
|
|
248
|
+
* Protocol for prompt management operations.
|
|
249
|
+
*/
|
|
268
250
|
prompts: API.Prompts = new API.Prompts(this);
|
|
251
|
+
/**
|
|
252
|
+
* Protocol for conversation management operations.
|
|
253
|
+
*/
|
|
269
254
|
conversations: API.Conversations = new API.Conversations(this);
|
|
255
|
+
/**
|
|
256
|
+
* APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers.
|
|
257
|
+
*/
|
|
270
258
|
inspect: API.Inspect = new API.Inspect(this);
|
|
259
|
+
/**
|
|
260
|
+
* Llama Stack Inference API for generating completions, chat completions, and embeddings.
|
|
261
|
+
*
|
|
262
|
+
* This API provides the raw interface to the underlying models. Three kinds of models are supported:
|
|
263
|
+
* - LLM models: these models generate "raw" and "chat" (conversational) completions.
|
|
264
|
+
* - Embedding models: these models generate embeddings to be used for semantic search.
|
|
265
|
+
* - Rerank models: these models reorder the documents based on their relevance to a query.
|
|
266
|
+
*/
|
|
271
267
|
embeddings: API.Embeddings = new API.Embeddings(this);
|
|
272
268
|
chat: API.Chat = new API.Chat(this);
|
|
269
|
+
/**
|
|
270
|
+
* Llama Stack Inference API for generating completions, chat completions, and embeddings.
|
|
271
|
+
*
|
|
272
|
+
* This API provides the raw interface to the underlying models. Three kinds of models are supported:
|
|
273
|
+
* - LLM models: these models generate "raw" and "chat" (conversational) completions.
|
|
274
|
+
* - Embedding models: these models generate embeddings to be used for semantic search.
|
|
275
|
+
* - Rerank models: these models reorder the documents based on their relevance to a query.
|
|
276
|
+
*/
|
|
273
277
|
completions: API.Completions = new API.Completions(this);
|
|
274
278
|
vectorIo: API.VectorIo = new API.VectorIo(this);
|
|
275
279
|
vectorStores: API.VectorStores = new API.VectorStores(this);
|
|
276
280
|
models: API.Models = new API.Models(this);
|
|
281
|
+
/**
|
|
282
|
+
* Providers API for inspecting, listing, and modifying providers and their configurations.
|
|
283
|
+
*/
|
|
277
284
|
providers: API.Providers = new API.Providers(this);
|
|
285
|
+
/**
|
|
286
|
+
* APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers.
|
|
287
|
+
*/
|
|
278
288
|
routes: API.Routes = new API.Routes(this);
|
|
289
|
+
/**
|
|
290
|
+
* OpenAI-compatible Moderations API.
|
|
291
|
+
*/
|
|
279
292
|
moderations: API.Moderations = new API.Moderations(this);
|
|
293
|
+
/**
|
|
294
|
+
* OpenAI-compatible Moderations API.
|
|
295
|
+
*/
|
|
280
296
|
safety: API.Safety = new API.Safety(this);
|
|
281
297
|
shields: API.Shields = new API.Shields(this);
|
|
282
298
|
scoring: API.Scoring = new API.Scoring(this);
|
|
283
299
|
scoringFunctions: API.ScoringFunctions = new API.ScoringFunctions(this);
|
|
300
|
+
/**
|
|
301
|
+
* This API is used to upload documents that can be used with other Llama Stack APIs.
|
|
302
|
+
*/
|
|
284
303
|
files: API.Files = new API.Files(this);
|
|
304
|
+
/**
|
|
305
|
+
* The API is designed to allow use of openai client libraries for seamless integration.
|
|
306
|
+
*
|
|
307
|
+
* This API provides the following extensions:
|
|
308
|
+
* - idempotent batch creation
|
|
309
|
+
*
|
|
310
|
+
* Note: This API is currently under active development and may undergo changes.
|
|
311
|
+
*/
|
|
285
312
|
batches: API.Batches = new API.Batches(this);
|
|
286
313
|
alpha: API.Alpha = new API.Alpha(this);
|
|
287
314
|
beta: API.Beta = new API.Beta(this);
|
|
@@ -311,8 +338,8 @@ export class LlamaStackClient extends Core.APIClient {
|
|
|
311
338
|
return { Authorization: `Bearer ${this.apiKey}` };
|
|
312
339
|
}
|
|
313
340
|
|
|
314
|
-
protected override stringifyQuery(query: Record<string, unknown>): string {
|
|
315
|
-
return
|
|
341
|
+
protected override stringifyQuery(query: object | Record<string, unknown>): string {
|
|
342
|
+
return stringifyQuery(query);
|
|
316
343
|
}
|
|
317
344
|
|
|
318
345
|
static LlamaStackClient = this;
|
|
@@ -336,9 +363,6 @@ export class LlamaStackClient extends Core.APIClient {
|
|
|
336
363
|
static fileFromPath = Uploads.fileFromPath;
|
|
337
364
|
}
|
|
338
365
|
|
|
339
|
-
LlamaStackClient.Toolgroups = Toolgroups;
|
|
340
|
-
LlamaStackClient.Tools = Tools;
|
|
341
|
-
LlamaStackClient.ToolRuntime = ToolRuntime;
|
|
342
366
|
LlamaStackClient.Responses = Responses;
|
|
343
367
|
LlamaStackClient.ResponseListResponsesOpenAICursorPage = ResponseListResponsesOpenAICursorPage;
|
|
344
368
|
LlamaStackClient.Prompts = Prompts;
|
|
@@ -380,25 +404,6 @@ export declare namespace LlamaStackClient {
|
|
|
380
404
|
type OpenAICursorPageResponse as OpenAICursorPageResponse,
|
|
381
405
|
};
|
|
382
406
|
|
|
383
|
-
export {
|
|
384
|
-
Toolgroups as Toolgroups,
|
|
385
|
-
type ListToolGroupsResponse as ListToolGroupsResponse,
|
|
386
|
-
type ToolGroup as ToolGroup,
|
|
387
|
-
type ToolgroupListResponse as ToolgroupListResponse,
|
|
388
|
-
type ToolgroupRegisterParams as ToolgroupRegisterParams,
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
export { Tools as Tools, type ToolListResponse as ToolListResponse, type ToolListParams as ToolListParams };
|
|
392
|
-
|
|
393
|
-
export {
|
|
394
|
-
ToolRuntime as ToolRuntime,
|
|
395
|
-
type ToolDef as ToolDef,
|
|
396
|
-
type ToolInvocationResult as ToolInvocationResult,
|
|
397
|
-
type ToolRuntimeListToolsResponse as ToolRuntimeListToolsResponse,
|
|
398
|
-
type ToolRuntimeInvokeToolParams as ToolRuntimeInvokeToolParams,
|
|
399
|
-
type ToolRuntimeListToolsParams as ToolRuntimeListToolsParams,
|
|
400
|
-
};
|
|
401
|
-
|
|
402
407
|
export {
|
|
403
408
|
Responses as Responses,
|
|
404
409
|
type ResponseObject as ResponseObject,
|
|
@@ -475,8 +480,6 @@ export declare namespace LlamaStackClient {
|
|
|
475
480
|
type Model as Model,
|
|
476
481
|
type ModelRetrieveResponse as ModelRetrieveResponse,
|
|
477
482
|
type ModelListResponse as ModelListResponse,
|
|
478
|
-
type ModelRegisterResponse as ModelRegisterResponse,
|
|
479
|
-
type ModelRegisterParams as ModelRegisterParams,
|
|
480
483
|
};
|
|
481
484
|
|
|
482
485
|
export { Providers as Providers, type ProviderListResponse as ProviderListResponse };
|
|
@@ -6,4 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import * as qs from '../qs/stringify';
|
|
10
|
+
|
|
11
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
12
|
+
return qs.stringify(query, { arrayFormat: 'comma' });
|
|
13
|
+
}
|
|
@@ -30,40 +30,20 @@ import {
|
|
|
30
30
|
EvaluateResponse,
|
|
31
31
|
Job,
|
|
32
32
|
} from './eval/eval';
|
|
33
|
-
import * as PostTrainingAPI from './post-training/post-training';
|
|
34
|
-
import {
|
|
35
|
-
AlgorithmConfig,
|
|
36
|
-
ListPostTrainingJobsResponse,
|
|
37
|
-
PostTraining,
|
|
38
|
-
PostTrainingJob,
|
|
39
|
-
PostTrainingPreferenceOptimizeParams,
|
|
40
|
-
PostTrainingSupervisedFineTuneParams,
|
|
41
|
-
} from './post-training/post-training';
|
|
42
33
|
|
|
43
34
|
export class Alpha extends APIResource {
|
|
44
|
-
postTraining: PostTrainingAPI.PostTraining = new PostTrainingAPI.PostTraining(this._client);
|
|
45
35
|
benchmarks: BenchmarksAPI.Benchmarks = new BenchmarksAPI.Benchmarks(this._client);
|
|
46
36
|
eval: EvalAPI.Eval = new EvalAPI.Eval(this._client);
|
|
47
37
|
admin: AdminAPI.Admin = new AdminAPI.Admin(this._client);
|
|
48
38
|
inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client);
|
|
49
39
|
}
|
|
50
40
|
|
|
51
|
-
Alpha.PostTraining = PostTraining;
|
|
52
41
|
Alpha.Benchmarks = Benchmarks;
|
|
53
42
|
Alpha.Eval = Eval;
|
|
54
43
|
Alpha.Admin = Admin;
|
|
55
44
|
Alpha.Inference = Inference;
|
|
56
45
|
|
|
57
46
|
export declare namespace Alpha {
|
|
58
|
-
export {
|
|
59
|
-
PostTraining as PostTraining,
|
|
60
|
-
type AlgorithmConfig as AlgorithmConfig,
|
|
61
|
-
type ListPostTrainingJobsResponse as ListPostTrainingJobsResponse,
|
|
62
|
-
type PostTrainingJob as PostTrainingJob,
|
|
63
|
-
type PostTrainingPreferenceOptimizeParams as PostTrainingPreferenceOptimizeParams,
|
|
64
|
-
type PostTrainingSupervisedFineTuneParams as PostTrainingSupervisedFineTuneParams,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
47
|
export {
|
|
68
48
|
Benchmarks as Benchmarks,
|
|
69
49
|
type Benchmark as Benchmark,
|
|
@@ -12,6 +12,9 @@ import * as Shared from '../../shared';
|
|
|
12
12
|
import * as JobsAPI from './jobs';
|
|
13
13
|
import { Jobs } from './jobs';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Llama Stack Evaluation API for running evaluations on model and agent candidates.
|
|
17
|
+
*/
|
|
15
18
|
export class Eval extends APIResource {
|
|
16
19
|
jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client);
|
|
17
20
|
|
|
@@ -10,6 +10,9 @@ import { APIResource } from '../../../resource';
|
|
|
10
10
|
import * as Core from '../../../core';
|
|
11
11
|
import * as EvalAPI from './eval';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Llama Stack Evaluation API for running evaluations on model and agent candidates.
|
|
15
|
+
*/
|
|
13
16
|
export class Jobs extends APIResource {
|
|
14
17
|
/**
|
|
15
18
|
* Get the result of a job.
|
|
@@ -26,11 +26,3 @@ export {
|
|
|
26
26
|
type EvalRunEvalAlphaParams,
|
|
27
27
|
} from './eval/index';
|
|
28
28
|
export { Inference, type InferenceRerankResponse, type InferenceRerankParams } from './inference';
|
|
29
|
-
export {
|
|
30
|
-
PostTraining,
|
|
31
|
-
type AlgorithmConfig,
|
|
32
|
-
type ListPostTrainingJobsResponse,
|
|
33
|
-
type PostTrainingJob,
|
|
34
|
-
type PostTrainingPreferenceOptimizeParams,
|
|
35
|
-
type PostTrainingSupervisedFineTuneParams,
|
|
36
|
-
} from './post-training/index';
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
import { APIResource } from '../../resource';
|
|
10
10
|
import * as Core from '../../core';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Llama Stack Inference API for generating completions, chat completions, and embeddings.
|
|
14
|
+
*
|
|
15
|
+
* This API provides the raw interface to the underlying models. Three kinds of models are supported:
|
|
16
|
+
* - LLM models: these models generate "raw" and "chat" (conversational) completions.
|
|
17
|
+
* - Embedding models: these models generate embeddings to be used for semantic search.
|
|
18
|
+
* - Rerank models: these models reorder the documents based on their relevance to a query.
|
|
19
|
+
*/
|
|
12
20
|
export class Inference extends APIResource {
|
|
13
21
|
/**
|
|
14
22
|
* Rerank a list of documents based on their relevance to a query.
|
package/src/resources/batches.ts
CHANGED
|
@@ -11,6 +11,14 @@ import { isRequestOptions } from '../core';
|
|
|
11
11
|
import * as Core from '../core';
|
|
12
12
|
import { OpenAICursorPage, type OpenAICursorPageParams } from '../pagination';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* The API is designed to allow use of openai client libraries for seamless integration.
|
|
16
|
+
*
|
|
17
|
+
* This API provides the following extensions:
|
|
18
|
+
* - idempotent batch creation
|
|
19
|
+
*
|
|
20
|
+
* Note: This API is currently under active development and may undergo changes.
|
|
21
|
+
*/
|
|
14
22
|
export class Batches extends APIResource {
|
|
15
23
|
/**
|
|
16
24
|
* Create a new batch for processing multiple API requests.
|
|
@@ -124,7 +124,7 @@ export interface DatasetRetrieveResponse {
|
|
|
124
124
|
/**
|
|
125
125
|
* Purpose of the dataset indicating its intended use
|
|
126
126
|
*/
|
|
127
|
-
purpose: '
|
|
127
|
+
purpose: 'eval/question-answer' | 'eval/messages-answer';
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* Data source configuration for the dataset
|
|
@@ -205,7 +205,7 @@ export namespace DatasetListResponse {
|
|
|
205
205
|
/**
|
|
206
206
|
* Purpose of the dataset indicating its intended use
|
|
207
207
|
*/
|
|
208
|
-
purpose: '
|
|
208
|
+
purpose: 'eval/question-answer' | 'eval/messages-answer';
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
211
|
* Data source configuration for the dataset
|
|
@@ -292,7 +292,7 @@ export interface DatasetRegisterResponse {
|
|
|
292
292
|
/**
|
|
293
293
|
* Purpose of the dataset indicating its intended use
|
|
294
294
|
*/
|
|
295
|
-
purpose: '
|
|
295
|
+
purpose: 'eval/question-answer' | 'eval/messages-answer';
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
298
|
* Data source configuration for the dataset
|
|
@@ -351,11 +351,6 @@ export namespace DatasetRegisterResponse {
|
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
export interface DatasetAppendrowsParams {
|
|
354
|
-
/**
|
|
355
|
-
* The ID of the dataset to append the rows to.
|
|
356
|
-
*/
|
|
357
|
-
body_dataset_id: string;
|
|
358
|
-
|
|
359
354
|
/**
|
|
360
355
|
* The rows to append to the dataset.
|
|
361
356
|
*/
|
|
@@ -378,7 +373,7 @@ export interface DatasetRegisterParams {
|
|
|
378
373
|
/**
|
|
379
374
|
* The purpose of the dataset.
|
|
380
375
|
*/
|
|
381
|
-
purpose: '
|
|
376
|
+
purpose: 'eval/question-answer' | 'eval/messages-answer';
|
|
382
377
|
|
|
383
378
|
/**
|
|
384
379
|
* The data source of the dataset.
|