unitysvc-data 0.1.5__tar.gz → 0.1.7__tar.gz
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.
- {unitysvc_data-0.1.5/src/unitysvc_data.egg-info → unitysvc_data-0.1.7}/PKG-INFO +1 -1
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/pyproject.toml +1 -1
- unitysvc_data-0.1.7/src/unitysvc_data/_manifest.json +455 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/api/connectivity/connectivity-v1.sh.j2 +5 -7
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-anthropic/README.md +41 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-anthropic/code-example-v1.py.j2 +18 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-embed-javascript/README.md +34 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-embed-javascript/code-example-embed-v1.js.j2 +23 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-embed-requests/README.md +45 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-embed-requests/code-example-embed-v1.py.j2 +19 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-embed-shell/README.md +34 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-embed-shell/code-example-embed-v1.sh.j2 +12 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-fc-requests/README.md +55 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-fc-requests/code-example-fc-v1.py.j2 +52 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-guard-requests/README.md +44 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-guard-requests/code-example-guard-v1.py.j2 +22 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-image-requests/README.md +49 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-image-requests/code-example-image-v1.py.j2 +28 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-javascript/README.md +36 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-javascript/code-example-v1.js.j2 +26 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-openai/README.md +42 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-openai/code-example-v1.py.j2 +17 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-openai-javascript/README.md +38 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-openai-javascript/code-example-v1.js.j2 +22 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-requests/README.md +44 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-requests/code-example-v1.py.j2 +20 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-rerank-requests/README.md +40 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-rerank-requests/code-example-rerank-v1.py.j2 +25 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-shell/README.md +36 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-shell/code-example-v1.sh.j2 +15 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-streaming-openai/README.md +39 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-streaming-openai/code-example-v1.py.j2 +23 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-streaming-openai-javascript/README.md +38 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-streaming-openai-javascript/code-example-v1.js.j2 +29 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-transcription-requests/README.md +50 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-transcription-requests/code-example-transcription-v1.py.j2 +23 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-tts-requests/README.md +49 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-tts-requests/code-example-tts-v1.py.j2 +25 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-vision-requests/README.md +51 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-vision-requests/code-example-vision-v1.py.j2 +31 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/description/README.md +40 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/description/description-v1.md +32 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/notification/description/README.md +29 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/notification/description/description-v1.md +20 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/recommender/description/README.md +32 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/recommender/description/description-v1.md +30 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/s3/code-example/code-example-v1.py.j2 +12 -11
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/s3/connectivity/connectivity-v1.py.j2 +9 -8
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/smtp/connectivity/connectivity-v1.sh.j2 +15 -15
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/smtp/connectivity/connectivity-v2.sh.j2 +18 -18
- unitysvc_data-0.1.7/src/unitysvc_data/examples/uptime/description/README.md +30 -0
- unitysvc_data-0.1.7/src/unitysvc_data/examples/uptime/description/description-v1.md +27 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7/src/unitysvc_data.egg-info}/PKG-INFO +1 -1
- unitysvc_data-0.1.7/src/unitysvc_data.egg-info/SOURCES.txt +76 -0
- unitysvc_data-0.1.5/src/unitysvc_data/_manifest.json +0 -113
- unitysvc_data-0.1.5/src/unitysvc_data.egg-info/SOURCES.txt +0 -32
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/LICENSE +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/README.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/setup.cfg +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/__init__.py +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/_registry.py +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/_version.py +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/cli.py +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/api/connectivity/README.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/llm/request-template/README.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/llm/request-template/request-template-v1.json +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/s3/code-example/README.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/s3/connectivity/README.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/s3/description/README.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/s3/description/description-v1.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/examples/smtp/connectivity/README.md +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/presets.py +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data/py.typed +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data.egg-info/dependency_links.txt +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data.egg-info/entry_points.txt +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data.egg-info/requires.txt +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/src/unitysvc_data.egg-info/top_level.txt +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/tests/test_build.py +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/tests/test_cli.py +0 -0
- {unitysvc_data-0.1.5 → unitysvc_data-0.1.7}/tests/test_presets.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "unitysvc-data"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.7"
|
|
8
8
|
description = "Standard examples and presets for UnitySVC data packages"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Bo Peng", email = "bo.peng@unitysvc.com" }]
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
{
|
|
2
|
+
"aliases": {
|
|
3
|
+
"api_connectivity": "api_connectivity_v1",
|
|
4
|
+
"llm_code_example_anthropic": "llm_code_example_anthropic_v1",
|
|
5
|
+
"llm_code_example_embed_javascript": "llm_code_example_embed_javascript_v1",
|
|
6
|
+
"llm_code_example_embed_requests": "llm_code_example_embed_requests_v1",
|
|
7
|
+
"llm_code_example_embed_shell": "llm_code_example_embed_shell_v1",
|
|
8
|
+
"llm_code_example_fc_requests": "llm_code_example_fc_requests_v1",
|
|
9
|
+
"llm_code_example_guard_requests": "llm_code_example_guard_requests_v1",
|
|
10
|
+
"llm_code_example_image_requests": "llm_code_example_image_requests_v1",
|
|
11
|
+
"llm_code_example_javascript": "llm_code_example_javascript_v1",
|
|
12
|
+
"llm_code_example_openai": "llm_code_example_openai_v1",
|
|
13
|
+
"llm_code_example_openai_javascript": "llm_code_example_openai_javascript_v1",
|
|
14
|
+
"llm_code_example_requests": "llm_code_example_requests_v1",
|
|
15
|
+
"llm_code_example_rerank_requests": "llm_code_example_rerank_requests_v1",
|
|
16
|
+
"llm_code_example_shell": "llm_code_example_shell_v1",
|
|
17
|
+
"llm_code_example_streaming_openai": "llm_code_example_streaming_openai_v1",
|
|
18
|
+
"llm_code_example_streaming_openai_javascript": "llm_code_example_streaming_openai_javascript_v1",
|
|
19
|
+
"llm_code_example_transcription_requests": "llm_code_example_transcription_requests_v1",
|
|
20
|
+
"llm_code_example_tts_requests": "llm_code_example_tts_requests_v1",
|
|
21
|
+
"llm_code_example_vision_requests": "llm_code_example_vision_requests_v1",
|
|
22
|
+
"llm_description": "llm_description_v1",
|
|
23
|
+
"llm_request_template": "llm_request_template_v1",
|
|
24
|
+
"notification_description": "notification_description_v1",
|
|
25
|
+
"recommender_description": "recommender_description_v1",
|
|
26
|
+
"s3_code_example": "s3_code_example_v1",
|
|
27
|
+
"s3_connectivity": "s3_connectivity_v1",
|
|
28
|
+
"s3_description": "s3_description_v1",
|
|
29
|
+
"smtp_connectivity": "smtp_connectivity_v2",
|
|
30
|
+
"uptime_description": "uptime_description_v1"
|
|
31
|
+
},
|
|
32
|
+
"presets": {
|
|
33
|
+
"api_connectivity_v1": {
|
|
34
|
+
"category": "connectivity_test",
|
|
35
|
+
"description": "Verify HTTP endpoint is reachable and returns a healthy status",
|
|
36
|
+
"example_file": "api/connectivity/connectivity-v1.sh.j2",
|
|
37
|
+
"is_active": true,
|
|
38
|
+
"is_public": false,
|
|
39
|
+
"meta": {
|
|
40
|
+
"output_contains": "connectivity ok"
|
|
41
|
+
},
|
|
42
|
+
"mime_type": "bash",
|
|
43
|
+
"preset_name": "api_connectivity",
|
|
44
|
+
"source_readme": "api/connectivity/README.md",
|
|
45
|
+
"version": 1
|
|
46
|
+
},
|
|
47
|
+
"llm_code_example_anthropic_v1": {
|
|
48
|
+
"category": "code_example",
|
|
49
|
+
"description": "Python example: send a message to an Anthropic-API-compatible LLM using the anthropic SDK",
|
|
50
|
+
"example_file": "llm/code-example-anthropic/code-example-v1.py.j2",
|
|
51
|
+
"is_active": true,
|
|
52
|
+
"is_public": true,
|
|
53
|
+
"meta": {
|
|
54
|
+
"requirements": [
|
|
55
|
+
"anthropic"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"mime_type": "python",
|
|
59
|
+
"preset_name": "llm_code_example_anthropic",
|
|
60
|
+
"source_readme": "llm/code-example-anthropic/README.md",
|
|
61
|
+
"version": 1
|
|
62
|
+
},
|
|
63
|
+
"llm_code_example_embed_javascript_v1": {
|
|
64
|
+
"category": "code_example",
|
|
65
|
+
"description": "JavaScript example: request OpenAI-compatible embeddings via fetch",
|
|
66
|
+
"example_file": "llm/code-example-embed-javascript/code-example-embed-v1.js.j2",
|
|
67
|
+
"is_active": true,
|
|
68
|
+
"is_public": true,
|
|
69
|
+
"meta": {},
|
|
70
|
+
"mime_type": "javascript",
|
|
71
|
+
"preset_name": "llm_code_example_embed_javascript",
|
|
72
|
+
"source_readme": "llm/code-example-embed-javascript/README.md",
|
|
73
|
+
"version": 1
|
|
74
|
+
},
|
|
75
|
+
"llm_code_example_embed_requests_v1": {
|
|
76
|
+
"category": "code_example",
|
|
77
|
+
"description": "Python example: request OpenAI-compatible embeddings for a list of inputs",
|
|
78
|
+
"example_file": "llm/code-example-embed-requests/code-example-embed-v1.py.j2",
|
|
79
|
+
"is_active": true,
|
|
80
|
+
"is_public": true,
|
|
81
|
+
"meta": {
|
|
82
|
+
"requirements": [
|
|
83
|
+
"requests"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"mime_type": "python",
|
|
87
|
+
"preset_name": "llm_code_example_embed_requests",
|
|
88
|
+
"source_readme": "llm/code-example-embed-requests/README.md",
|
|
89
|
+
"version": 1
|
|
90
|
+
},
|
|
91
|
+
"llm_code_example_embed_shell_v1": {
|
|
92
|
+
"category": "code_example",
|
|
93
|
+
"description": "Shell example: request OpenAI-compatible embeddings via curl",
|
|
94
|
+
"example_file": "llm/code-example-embed-shell/code-example-embed-v1.sh.j2",
|
|
95
|
+
"is_active": true,
|
|
96
|
+
"is_public": true,
|
|
97
|
+
"meta": {},
|
|
98
|
+
"mime_type": "bash",
|
|
99
|
+
"preset_name": "llm_code_example_embed_shell",
|
|
100
|
+
"source_readme": "llm/code-example-embed-shell/README.md",
|
|
101
|
+
"version": 1
|
|
102
|
+
},
|
|
103
|
+
"llm_code_example_fc_requests_v1": {
|
|
104
|
+
"category": "code_example",
|
|
105
|
+
"description": "Python example: chat completion with function/tool calling on an OpenAI-compatible LLM",
|
|
106
|
+
"example_file": "llm/code-example-fc-requests/code-example-fc-v1.py.j2",
|
|
107
|
+
"is_active": true,
|
|
108
|
+
"is_public": true,
|
|
109
|
+
"meta": {
|
|
110
|
+
"requirements": [
|
|
111
|
+
"requests"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"mime_type": "python",
|
|
115
|
+
"preset_name": "llm_code_example_fc_requests",
|
|
116
|
+
"source_readme": "llm/code-example-fc-requests/README.md",
|
|
117
|
+
"version": 1
|
|
118
|
+
},
|
|
119
|
+
"llm_code_example_guard_requests_v1": {
|
|
120
|
+
"category": "code_example",
|
|
121
|
+
"description": "Python example: probe a Llama-Guard-style safety classifier with a borderline prompt",
|
|
122
|
+
"example_file": "llm/code-example-guard-requests/code-example-guard-v1.py.j2",
|
|
123
|
+
"is_active": true,
|
|
124
|
+
"is_public": true,
|
|
125
|
+
"meta": {
|
|
126
|
+
"requirements": [
|
|
127
|
+
"requests"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"mime_type": "python",
|
|
131
|
+
"preset_name": "llm_code_example_guard_requests",
|
|
132
|
+
"source_readme": "llm/code-example-guard-requests/README.md",
|
|
133
|
+
"version": 1
|
|
134
|
+
},
|
|
135
|
+
"llm_code_example_image_requests_v1": {
|
|
136
|
+
"category": "code_example",
|
|
137
|
+
"description": "Python example: generate an image from a text prompt via an OpenAI-compatible images endpoint",
|
|
138
|
+
"example_file": "llm/code-example-image-requests/code-example-image-v1.py.j2",
|
|
139
|
+
"is_active": true,
|
|
140
|
+
"is_public": true,
|
|
141
|
+
"meta": {
|
|
142
|
+
"requirements": [
|
|
143
|
+
"requests"
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"mime_type": "python",
|
|
147
|
+
"preset_name": "llm_code_example_image_requests",
|
|
148
|
+
"source_readme": "llm/code-example-image-requests/README.md",
|
|
149
|
+
"version": 1
|
|
150
|
+
},
|
|
151
|
+
"llm_code_example_javascript_v1": {
|
|
152
|
+
"category": "code_example",
|
|
153
|
+
"description": "JavaScript example: send a chat completion request to an OpenAI-compatible LLM",
|
|
154
|
+
"example_file": "llm/code-example-javascript/code-example-v1.js.j2",
|
|
155
|
+
"is_active": true,
|
|
156
|
+
"is_public": true,
|
|
157
|
+
"meta": {},
|
|
158
|
+
"mime_type": "javascript",
|
|
159
|
+
"preset_name": "llm_code_example_javascript",
|
|
160
|
+
"source_readme": "llm/code-example-javascript/README.md",
|
|
161
|
+
"version": 1
|
|
162
|
+
},
|
|
163
|
+
"llm_code_example_openai_javascript_v1": {
|
|
164
|
+
"category": "code_example",
|
|
165
|
+
"description": "JavaScript example: send a chat completion request to an OpenAI-compatible LLM using the openai SDK",
|
|
166
|
+
"example_file": "llm/code-example-openai-javascript/code-example-v1.js.j2",
|
|
167
|
+
"is_active": true,
|
|
168
|
+
"is_public": true,
|
|
169
|
+
"meta": {
|
|
170
|
+
"requirements": [
|
|
171
|
+
"openai"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"mime_type": "javascript",
|
|
175
|
+
"preset_name": "llm_code_example_openai_javascript",
|
|
176
|
+
"source_readme": "llm/code-example-openai-javascript/README.md",
|
|
177
|
+
"version": 1
|
|
178
|
+
},
|
|
179
|
+
"llm_code_example_openai_v1": {
|
|
180
|
+
"category": "code_example",
|
|
181
|
+
"description": "Python example: send a chat completion request to an OpenAI-compatible LLM using the openai SDK",
|
|
182
|
+
"example_file": "llm/code-example-openai/code-example-v1.py.j2",
|
|
183
|
+
"is_active": true,
|
|
184
|
+
"is_public": true,
|
|
185
|
+
"meta": {
|
|
186
|
+
"requirements": [
|
|
187
|
+
"openai"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"mime_type": "python",
|
|
191
|
+
"preset_name": "llm_code_example_openai",
|
|
192
|
+
"source_readme": "llm/code-example-openai/README.md",
|
|
193
|
+
"version": 1
|
|
194
|
+
},
|
|
195
|
+
"llm_code_example_requests_v1": {
|
|
196
|
+
"category": "code_example",
|
|
197
|
+
"description": "Python example: send a chat completion request to an OpenAI-compatible LLM using the requests library",
|
|
198
|
+
"example_file": "llm/code-example-requests/code-example-v1.py.j2",
|
|
199
|
+
"is_active": true,
|
|
200
|
+
"is_public": true,
|
|
201
|
+
"meta": {
|
|
202
|
+
"requirements": [
|
|
203
|
+
"requests"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"mime_type": "python",
|
|
207
|
+
"preset_name": "llm_code_example_requests",
|
|
208
|
+
"source_readme": "llm/code-example-requests/README.md",
|
|
209
|
+
"version": 1
|
|
210
|
+
},
|
|
211
|
+
"llm_code_example_rerank_requests_v1": {
|
|
212
|
+
"category": "code_example",
|
|
213
|
+
"description": "Python example: rerank a candidate document set against a query",
|
|
214
|
+
"example_file": "llm/code-example-rerank-requests/code-example-rerank-v1.py.j2",
|
|
215
|
+
"is_active": true,
|
|
216
|
+
"is_public": true,
|
|
217
|
+
"meta": {
|
|
218
|
+
"requirements": [
|
|
219
|
+
"requests"
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
"mime_type": "python",
|
|
223
|
+
"preset_name": "llm_code_example_rerank_requests",
|
|
224
|
+
"source_readme": "llm/code-example-rerank-requests/README.md",
|
|
225
|
+
"version": 1
|
|
226
|
+
},
|
|
227
|
+
"llm_code_example_shell_v1": {
|
|
228
|
+
"category": "code_example",
|
|
229
|
+
"description": "Shell example: send a chat completion request to an OpenAI-compatible LLM via curl",
|
|
230
|
+
"example_file": "llm/code-example-shell/code-example-v1.sh.j2",
|
|
231
|
+
"is_active": true,
|
|
232
|
+
"is_public": true,
|
|
233
|
+
"meta": {},
|
|
234
|
+
"mime_type": "bash",
|
|
235
|
+
"preset_name": "llm_code_example_shell",
|
|
236
|
+
"source_readme": "llm/code-example-shell/README.md",
|
|
237
|
+
"version": 1
|
|
238
|
+
},
|
|
239
|
+
"llm_code_example_streaming_openai_javascript_v1": {
|
|
240
|
+
"category": "code_example",
|
|
241
|
+
"description": "JavaScript example: stream a chat completion from an OpenAI-compatible LLM using the openai SDK",
|
|
242
|
+
"example_file": "llm/code-example-streaming-openai-javascript/code-example-v1.js.j2",
|
|
243
|
+
"is_active": true,
|
|
244
|
+
"is_public": true,
|
|
245
|
+
"meta": {
|
|
246
|
+
"requirements": [
|
|
247
|
+
"openai"
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
"mime_type": "javascript",
|
|
251
|
+
"preset_name": "llm_code_example_streaming_openai_javascript",
|
|
252
|
+
"source_readme": "llm/code-example-streaming-openai-javascript/README.md",
|
|
253
|
+
"version": 1
|
|
254
|
+
},
|
|
255
|
+
"llm_code_example_streaming_openai_v1": {
|
|
256
|
+
"category": "code_example",
|
|
257
|
+
"description": "Python example: stream a chat completion from an OpenAI-compatible LLM using the openai SDK",
|
|
258
|
+
"example_file": "llm/code-example-streaming-openai/code-example-v1.py.j2",
|
|
259
|
+
"is_active": true,
|
|
260
|
+
"is_public": true,
|
|
261
|
+
"meta": {
|
|
262
|
+
"requirements": [
|
|
263
|
+
"openai"
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
"mime_type": "python",
|
|
267
|
+
"preset_name": "llm_code_example_streaming_openai",
|
|
268
|
+
"source_readme": "llm/code-example-streaming-openai/README.md",
|
|
269
|
+
"version": 1
|
|
270
|
+
},
|
|
271
|
+
"llm_code_example_transcription_requests_v1": {
|
|
272
|
+
"category": "code_example",
|
|
273
|
+
"description": "Python example: transcribe a pre-recorded audio file with an OpenAI-compatible audio transcription endpoint",
|
|
274
|
+
"example_file": "llm/code-example-transcription-requests/code-example-transcription-v1.py.j2",
|
|
275
|
+
"is_active": true,
|
|
276
|
+
"is_public": true,
|
|
277
|
+
"meta": {
|
|
278
|
+
"requirements": [
|
|
279
|
+
"requests"
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
"mime_type": "python",
|
|
283
|
+
"preset_name": "llm_code_example_transcription_requests",
|
|
284
|
+
"source_readme": "llm/code-example-transcription-requests/README.md",
|
|
285
|
+
"version": 1
|
|
286
|
+
},
|
|
287
|
+
"llm_code_example_tts_requests_v1": {
|
|
288
|
+
"category": "code_example",
|
|
289
|
+
"description": "Python example: synthesize speech from text using an OpenAI-compatible audio/speech endpoint",
|
|
290
|
+
"example_file": "llm/code-example-tts-requests/code-example-tts-v1.py.j2",
|
|
291
|
+
"is_active": true,
|
|
292
|
+
"is_public": true,
|
|
293
|
+
"meta": {
|
|
294
|
+
"requirements": [
|
|
295
|
+
"requests"
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
"mime_type": "python",
|
|
299
|
+
"preset_name": "llm_code_example_tts_requests",
|
|
300
|
+
"source_readme": "llm/code-example-tts-requests/README.md",
|
|
301
|
+
"version": 1
|
|
302
|
+
},
|
|
303
|
+
"llm_code_example_vision_requests_v1": {
|
|
304
|
+
"category": "code_example",
|
|
305
|
+
"description": "Python example: ask a vision-capable LLM about a publicly-hosted image",
|
|
306
|
+
"example_file": "llm/code-example-vision-requests/code-example-vision-v1.py.j2",
|
|
307
|
+
"is_active": true,
|
|
308
|
+
"is_public": true,
|
|
309
|
+
"meta": {
|
|
310
|
+
"requirements": [
|
|
311
|
+
"requests"
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
"mime_type": "python",
|
|
315
|
+
"preset_name": "llm_code_example_vision_requests",
|
|
316
|
+
"source_readme": "llm/code-example-vision-requests/README.md",
|
|
317
|
+
"version": 1
|
|
318
|
+
},
|
|
319
|
+
"llm_description_v1": {
|
|
320
|
+
"category": "getting_started",
|
|
321
|
+
"description": "Customer-facing overview of an OpenAI-compatible LLM gateway service",
|
|
322
|
+
"example_file": "llm/description/description-v1.md",
|
|
323
|
+
"is_active": true,
|
|
324
|
+
"is_public": true,
|
|
325
|
+
"meta": {},
|
|
326
|
+
"mime_type": "markdown",
|
|
327
|
+
"preset_name": "llm_description",
|
|
328
|
+
"source_readme": "llm/description/README.md",
|
|
329
|
+
"version": 1
|
|
330
|
+
},
|
|
331
|
+
"llm_request_template_v1": {
|
|
332
|
+
"category": "request_template",
|
|
333
|
+
"description": "Minimal OpenAI-compatible chat completion request body",
|
|
334
|
+
"example_file": "llm/request-template/request-template-v1.json",
|
|
335
|
+
"is_active": true,
|
|
336
|
+
"is_public": false,
|
|
337
|
+
"meta": {},
|
|
338
|
+
"mime_type": "json",
|
|
339
|
+
"preset_name": "llm_request_template",
|
|
340
|
+
"source_readme": "llm/request-template/README.md",
|
|
341
|
+
"version": 1
|
|
342
|
+
},
|
|
343
|
+
"notification_description_v1": {
|
|
344
|
+
"category": "getting_started",
|
|
345
|
+
"description": "Customer-facing overview of a ntfy-shaped push-notification gateway service",
|
|
346
|
+
"example_file": "notification/description/description-v1.md",
|
|
347
|
+
"is_active": true,
|
|
348
|
+
"is_public": true,
|
|
349
|
+
"meta": {},
|
|
350
|
+
"mime_type": "markdown",
|
|
351
|
+
"preset_name": "notification_description",
|
|
352
|
+
"source_readme": "notification/description/README.md",
|
|
353
|
+
"version": 1
|
|
354
|
+
},
|
|
355
|
+
"recommender_description_v1": {
|
|
356
|
+
"category": "getting_started",
|
|
357
|
+
"description": "Customer-facing overview of a Gorse-shaped recommender gateway service",
|
|
358
|
+
"example_file": "recommender/description/description-v1.md",
|
|
359
|
+
"is_active": true,
|
|
360
|
+
"is_public": true,
|
|
361
|
+
"meta": {},
|
|
362
|
+
"mime_type": "markdown",
|
|
363
|
+
"preset_name": "recommender_description",
|
|
364
|
+
"source_readme": "recommender/description/README.md",
|
|
365
|
+
"version": 1
|
|
366
|
+
},
|
|
367
|
+
"s3_code_example_v1": {
|
|
368
|
+
"category": "code_example",
|
|
369
|
+
"description": "Python example: list objects in an S3 bucket via boto3",
|
|
370
|
+
"example_file": "s3/code-example/code-example-v1.py.j2",
|
|
371
|
+
"is_active": true,
|
|
372
|
+
"is_public": true,
|
|
373
|
+
"meta": {
|
|
374
|
+
"output_contains": "connectivity ok",
|
|
375
|
+
"requirements": [
|
|
376
|
+
"boto3"
|
|
377
|
+
]
|
|
378
|
+
},
|
|
379
|
+
"mime_type": "python",
|
|
380
|
+
"preset_name": "s3_code_example",
|
|
381
|
+
"source_readme": "s3/code-example/README.md",
|
|
382
|
+
"version": 1
|
|
383
|
+
},
|
|
384
|
+
"s3_connectivity_v1": {
|
|
385
|
+
"category": "connectivity_test",
|
|
386
|
+
"description": "Verify S3 endpoint accepts the configured credentials",
|
|
387
|
+
"example_file": "s3/connectivity/connectivity-v1.py.j2",
|
|
388
|
+
"is_active": true,
|
|
389
|
+
"is_public": false,
|
|
390
|
+
"meta": {
|
|
391
|
+
"output_contains": "connectivity ok",
|
|
392
|
+
"requirements": [
|
|
393
|
+
"boto3"
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
"mime_type": "python",
|
|
397
|
+
"preset_name": "s3_connectivity",
|
|
398
|
+
"source_readme": "s3/connectivity/README.md",
|
|
399
|
+
"version": 1
|
|
400
|
+
},
|
|
401
|
+
"s3_description_v1": {
|
|
402
|
+
"category": "getting_started",
|
|
403
|
+
"description": "Customer-facing overview of the S3 gateway service",
|
|
404
|
+
"example_file": "s3/description/description-v1.md",
|
|
405
|
+
"is_active": true,
|
|
406
|
+
"is_public": true,
|
|
407
|
+
"meta": {},
|
|
408
|
+
"mime_type": "markdown",
|
|
409
|
+
"preset_name": "s3_description",
|
|
410
|
+
"source_readme": "s3/description/README.md",
|
|
411
|
+
"version": 1
|
|
412
|
+
},
|
|
413
|
+
"smtp_connectivity_v1": {
|
|
414
|
+
"category": "connectivity_test",
|
|
415
|
+
"description": "Verify SMTP server returns a 220 greeting on connect",
|
|
416
|
+
"example_file": "smtp/connectivity/connectivity-v1.sh.j2",
|
|
417
|
+
"is_active": true,
|
|
418
|
+
"is_public": false,
|
|
419
|
+
"meta": {
|
|
420
|
+
"output_contains": "connectivity ok"
|
|
421
|
+
},
|
|
422
|
+
"mime_type": "bash",
|
|
423
|
+
"preset_name": "smtp_connectivity",
|
|
424
|
+
"source_readme": "smtp/connectivity/README.md",
|
|
425
|
+
"version": 1
|
|
426
|
+
},
|
|
427
|
+
"smtp_connectivity_v2": {
|
|
428
|
+
"category": "connectivity_test",
|
|
429
|
+
"description": "Verify SMTP server returns a 220 greeting on connect",
|
|
430
|
+
"example_file": "smtp/connectivity/connectivity-v2.sh.j2",
|
|
431
|
+
"is_active": true,
|
|
432
|
+
"is_public": false,
|
|
433
|
+
"meta": {
|
|
434
|
+
"output_contains": "connectivity ok"
|
|
435
|
+
},
|
|
436
|
+
"mime_type": "bash",
|
|
437
|
+
"preset_name": "smtp_connectivity",
|
|
438
|
+
"source_readme": "smtp/connectivity/README.md",
|
|
439
|
+
"version": 2
|
|
440
|
+
},
|
|
441
|
+
"uptime_description_v1": {
|
|
442
|
+
"category": "getting_started",
|
|
443
|
+
"description": "Customer-facing overview of an uptime-monitoring bridge service",
|
|
444
|
+
"example_file": "uptime/description/description-v1.md",
|
|
445
|
+
"is_active": true,
|
|
446
|
+
"is_public": true,
|
|
447
|
+
"meta": {},
|
|
448
|
+
"mime_type": "markdown",
|
|
449
|
+
"preset_name": "uptime_description",
|
|
450
|
+
"source_readme": "uptime/description/README.md",
|
|
451
|
+
"version": 1
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"version": "1"
|
|
455
|
+
}
|
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
# variants). Verifies the endpoint is reachable AND serves a sensible
|
|
4
4
|
# response. 404 / 5xx / DNS / timeout all count as failure.
|
|
5
5
|
#
|
|
6
|
-
# The
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
# Because the variable names are identical we don't branch on
|
|
11
|
-
# local_testing for this test — the script works in both modes.
|
|
6
|
+
# The base URL is rendered into the script at template-render time
|
|
7
|
+
# (gateway URL for ``test_gateway`` context, upstream URL for
|
|
8
|
+
# ``test_local``). The API key intentionally stays as an env-var
|
|
9
|
+
# lookup — never inline a real key into rendered output.
|
|
12
10
|
set -o pipefail
|
|
13
11
|
|
|
14
|
-
URL="
|
|
12
|
+
URL="{{ service_base_url }}"
|
|
15
13
|
|
|
16
14
|
# Split the curl invocation rather than expanding an empty array under
|
|
17
15
|
# `set -u` (bash 3.2 on macOS raises on "${arr[@]}" when arr is empty).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
+++
|
|
2
|
+
preset_name = "llm_code_example_anthropic"
|
|
3
|
+
category = "code_example"
|
|
4
|
+
mime_type = "python"
|
|
5
|
+
file = "code-example.py.j2"
|
|
6
|
+
description = "Python example: send a message to an Anthropic-API-compatible LLM using the anthropic SDK"
|
|
7
|
+
is_active = true
|
|
8
|
+
is_public = true
|
|
9
|
+
meta = { requirements = ["anthropic"] }
|
|
10
|
+
+++
|
|
11
|
+
|
|
12
|
+
# llm / code-example-anthropic — Anthropic Messages API via the `anthropic` SDK
|
|
13
|
+
|
|
14
|
+
Customer-facing Python example for upstreams that speak the
|
|
15
|
+
Anthropic Messages API (`/v1/messages`) — primarily Claude-family
|
|
16
|
+
models. The Anthropic API is **not** OpenAI-compatible: the
|
|
17
|
+
endpoint differs (`/v1/messages` vs `/v1/chat/completions`),
|
|
18
|
+
`max_tokens` is required, the `system` prompt is a top-level field
|
|
19
|
+
rather than a message, and the response shape is `content[].text`
|
|
20
|
+
rather than `choices[].message.content`. So Anthropic-shaped
|
|
21
|
+
upstreams need their own preset rather than reusing
|
|
22
|
+
`llm_code_example_openai`.
|
|
23
|
+
|
|
24
|
+
## Environment variables (all required)
|
|
25
|
+
|
|
26
|
+
- `SERVICE_BASE_URL` — Messages endpoint, passed as the SDK's
|
|
27
|
+
`base_url`.
|
|
28
|
+
- `UNITYSVC_API_KEY` — passed as the SDK's `api_key`.
|
|
29
|
+
- `MODEL` — interface-specific model identifier.
|
|
30
|
+
|
|
31
|
+
## Versions
|
|
32
|
+
|
|
33
|
+
### v1 — initial release
|
|
34
|
+
|
|
35
|
+
- `Anthropic(base_url=..., api_key=...)` then
|
|
36
|
+
`client.messages.create(...)` with `max_tokens=1024` and a
|
|
37
|
+
top-level `system` prompt.
|
|
38
|
+
- HTTP errors surface as `anthropic.APIStatusError` (non-zero
|
|
39
|
+
exit), so no explicit status check is needed.
|
|
40
|
+
- Reads `UNITYSVC_API_KEY`, `SERVICE_BASE_URL`, `MODEL` from the
|
|
41
|
+
environment; missing any of the three fails fast with `KeyError`.
|
unitysvc_data-0.1.7/src/unitysvc_data/examples/llm/code-example-anthropic/code-example-v1.py.j2
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from anthropic import Anthropic
|
|
4
|
+
|
|
5
|
+
client = Anthropic(
|
|
6
|
+
base_url="{{ service_base_url }}",
|
|
7
|
+
api_key=os.environ["UNITYSVC_API_KEY"],
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
response = client.messages.create(
|
|
11
|
+
model="{{ routing_key.model }}",
|
|
12
|
+
max_tokens=1024,
|
|
13
|
+
system="You are a helpful assistant.",
|
|
14
|
+
messages=[
|
|
15
|
+
{"role": "user", "content": "Say this is a test"},
|
|
16
|
+
],
|
|
17
|
+
)
|
|
18
|
+
print(response.content[0].text)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
+++
|
|
2
|
+
preset_name = "llm_code_example_embed_javascript"
|
|
3
|
+
category = "code_example"
|
|
4
|
+
mime_type = "javascript"
|
|
5
|
+
file = "code-example-embed.js.j2"
|
|
6
|
+
description = "JavaScript example: request OpenAI-compatible embeddings via fetch"
|
|
7
|
+
is_active = true
|
|
8
|
+
is_public = true
|
|
9
|
+
+++
|
|
10
|
+
|
|
11
|
+
# llm / code-example-embed-javascript — embeddings via `fetch`
|
|
12
|
+
|
|
13
|
+
Customer-facing Node.js example for OpenAI-compatible embedding
|
|
14
|
+
endpoints. Uses the built-in `fetch` API (Node 18+).
|
|
15
|
+
|
|
16
|
+
## Environment variables (all required)
|
|
17
|
+
|
|
18
|
+
- `SERVICE_BASE_URL` — embeddings endpoint.
|
|
19
|
+
- `UNITYSVC_API_KEY` — bearer token.
|
|
20
|
+
- `MODEL` — interface-specific model identifier. The script does not
|
|
21
|
+
fall back to `offering.name` because the model id is a routing
|
|
22
|
+
key and can differ between the gateway and the upstream — the
|
|
23
|
+
caller must supply the correct one for the access interface.
|
|
24
|
+
|
|
25
|
+
## Versions
|
|
26
|
+
|
|
27
|
+
### v1 — initial release
|
|
28
|
+
|
|
29
|
+
- `fetch` POST with `model` + two-element `input` array.
|
|
30
|
+
- A small loop checks the three required env vars before the request
|
|
31
|
+
and exits 1 on any missing one.
|
|
32
|
+
- Prints the dimensionality and first three components of each
|
|
33
|
+
returned vector.
|
|
34
|
+
- Plain JavaScript (no `.j2` suffix) — no Jinja2 expansion.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
async function main() {
|
|
2
|
+
const response = await fetch("{{ service_base_url }}/embeddings", {
|
|
3
|
+
method: "POST",
|
|
4
|
+
headers: {
|
|
5
|
+
Authorization: `Bearer ${process.env.UNITYSVC_API_KEY}`,
|
|
6
|
+
"Content-Type": "application/json",
|
|
7
|
+
},
|
|
8
|
+
body: JSON.stringify({
|
|
9
|
+
model: "{{ routing_key.model }}",
|
|
10
|
+
input: ["Embed this sentence.", "As well as this one."],
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
|
|
15
|
+
}
|
|
16
|
+
const { data } = await response.json();
|
|
17
|
+
console.log(`got ${data.length} embeddings of dimension ${data[0].embedding.length}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
main().catch((err) => {
|
|
21
|
+
console.error(err.message);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
+++
|
|
2
|
+
preset_name = "llm_code_example_embed_requests"
|
|
3
|
+
category = "code_example"
|
|
4
|
+
mime_type = "python"
|
|
5
|
+
file = "code-example-embed.py.j2"
|
|
6
|
+
description = "Python example: request OpenAI-compatible embeddings for a list of inputs"
|
|
7
|
+
is_active = true
|
|
8
|
+
is_public = true
|
|
9
|
+
meta = { requirements = ["requests"] }
|
|
10
|
+
+++
|
|
11
|
+
|
|
12
|
+
# llm / code-example-embed-requests — embeddings via `requests`
|
|
13
|
+
|
|
14
|
+
Customer-facing Python example for OpenAI-compatible embedding
|
|
15
|
+
endpoints (`/v1/embeddings`-shaped) routed through the UnitySVC LLM
|
|
16
|
+
gateway.
|
|
17
|
+
|
|
18
|
+
## Environment variables (all required)
|
|
19
|
+
|
|
20
|
+
- `SERVICE_BASE_URL` — embeddings endpoint (gateway URL or upstream
|
|
21
|
+
URL in local-testing mode). The gateway sets this to its own
|
|
22
|
+
`/v1/embeddings` route.
|
|
23
|
+
- `UNITYSVC_API_KEY` — bearer token.
|
|
24
|
+
- `MODEL` — interface-specific model identifier. The script does not
|
|
25
|
+
fall back to `offering.name` because the model id is a routing
|
|
26
|
+
key and can differ between the gateway and the upstream — the
|
|
27
|
+
caller must supply the correct one for the access interface.
|
|
28
|
+
|
|
29
|
+
## Conventions
|
|
30
|
+
|
|
31
|
+
- Posts a list of two short strings as `input` and prints the
|
|
32
|
+
dimensionality + the first three components of each returned vector
|
|
33
|
+
so the script verifies the response shape without dumping a wall of
|
|
34
|
+
floats.
|
|
35
|
+
- Uses the OpenAI-compatible response shape: `data[].embedding` is a
|
|
36
|
+
flat list of floats.
|
|
37
|
+
|
|
38
|
+
## Versions
|
|
39
|
+
|
|
40
|
+
### v1 — initial release
|
|
41
|
+
|
|
42
|
+
- `requests.post` against `SERVICE_BASE_URL` with `model` + `input`.
|
|
43
|
+
- Reads `UNITYSVC_API_KEY`, `SERVICE_BASE_URL`, `MODEL` from env;
|
|
44
|
+
missing any of the three fails fast with `KeyError`.
|
|
45
|
+
- Plain Python (no `.j2` suffix) — no Jinja2 expansion.
|