lyceum-cli 1.0.18__py3-none-any.whl → 1.0.19__py3-none-any.whl
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.
- lyceum/external/compute/inference/chat.py +30 -4
- {lyceum_cli-1.0.18.dist-info → lyceum_cli-1.0.19.dist-info}/METADATA +1 -1
- {lyceum_cli-1.0.18.dist-info → lyceum_cli-1.0.19.dist-info}/RECORD +6 -6
- {lyceum_cli-1.0.18.dist-info → lyceum_cli-1.0.19.dist-info}/WHEEL +0 -0
- {lyceum_cli-1.0.18.dist-info → lyceum_cli-1.0.19.dist-info}/entry_points.txt +0 -0
- {lyceum_cli-1.0.18.dist-info → lyceum_cli-1.0.19.dist-info}/top_level.txt +0 -0
|
@@ -167,24 +167,50 @@ def list_models():
|
|
|
167
167
|
|
|
168
168
|
@chat_app.command("image")
|
|
169
169
|
def analyze_image(
|
|
170
|
-
|
|
170
|
+
image_source: str = typer.Argument(..., help="Image URL or path to base64 file"),
|
|
171
171
|
prompt: str = typer.Option("What do you see in this image?", "--prompt", "-p", help="Question about the image"),
|
|
172
|
-
model: str = typer.Option("
|
|
172
|
+
model: str = typer.Option("paddleocr-vl", "--model", "-m", help="Vision model to use"),
|
|
173
|
+
base64: bool = typer.Option(False, "--base64", "-b", help="Treat image_source as path to base64 file"),
|
|
173
174
|
):
|
|
174
175
|
"""Analyze an image with AI vision models"""
|
|
175
176
|
try:
|
|
176
177
|
client = config.get_client()
|
|
177
|
-
|
|
178
|
+
|
|
179
|
+
# Prepare image data
|
|
180
|
+
image_url = None
|
|
181
|
+
image_data = None
|
|
182
|
+
|
|
183
|
+
if base64:
|
|
184
|
+
# Read base64 from file
|
|
185
|
+
from pathlib import Path
|
|
186
|
+
base64_path = Path(image_source)
|
|
187
|
+
if not base64_path.exists():
|
|
188
|
+
console.print(f"[red]❌ File not found: {image_source}[/red]")
|
|
189
|
+
raise typer.Exit(1)
|
|
190
|
+
|
|
191
|
+
with open(base64_path, 'r') as f:
|
|
192
|
+
image_data = f.read().strip()
|
|
193
|
+
|
|
194
|
+
console.print(f"[dim]📄 Read base64 image from {image_source} ({len(image_data)} chars)[/dim]")
|
|
195
|
+
else:
|
|
196
|
+
# Use as URL
|
|
197
|
+
image_url = image_source
|
|
198
|
+
|
|
178
199
|
# Create request payload for image analysis
|
|
179
200
|
sync_request = {
|
|
180
201
|
"model_id": model,
|
|
181
202
|
"input": {
|
|
182
203
|
"text": prompt,
|
|
183
|
-
"image_url": image_url
|
|
184
204
|
},
|
|
185
205
|
"max_tokens": 1000,
|
|
186
206
|
"temperature": 0.7
|
|
187
207
|
}
|
|
208
|
+
|
|
209
|
+
# Add image data
|
|
210
|
+
if image_data:
|
|
211
|
+
sync_request["input"]["image_data"] = image_data
|
|
212
|
+
else:
|
|
213
|
+
sync_request["input"]["image_url"] = image_url
|
|
188
214
|
|
|
189
215
|
console.print(f"[dim]👁️ Analyzing image with {model}...[/dim]")
|
|
190
216
|
|
|
@@ -8,7 +8,7 @@ lyceum/external/compute/execution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
8
8
|
lyceum/external/compute/execution/python.py,sha256=IiQpudxLAD4lMaQsvON6MGPNGYtEW9Zoip9dSv8KI0g,3745
|
|
9
9
|
lyceum/external/compute/inference/__init__.py,sha256=4YLoUKDEzitexynJv_Q5O0w1lty8CJ6uyRxuc1LiaBw,89
|
|
10
10
|
lyceum/external/compute/inference/batch.py,sha256=OHwJndqvsQx0K0-3to8Tc9HB2xA6iq1MNvXvpMxi5Oc,11775
|
|
11
|
-
lyceum/external/compute/inference/chat.py,sha256=
|
|
11
|
+
lyceum/external/compute/inference/chat.py,sha256=Dx7HssW3cCRftcWo7eXZ6VHEVBcHNTODdX-Q9NepRoU,9668
|
|
12
12
|
lyceum/external/compute/inference/models.py,sha256=VVHMUhTPVhLKiuvC9Q1zvBD-lM4KDJPUqTmFO7kHpUA,10319
|
|
13
13
|
lyceum/external/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
lyceum/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -18,8 +18,8 @@ lyceum/shared/streaming.py,sha256=-_MLgrACwe1oU5n3UG4kzg9TcUQXc3cLNV6WyplEc_k,60
|
|
|
18
18
|
lyceum_cloud_execution_api_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
lyceum_cloud_execution_api_client/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
lyceum_cloud_execution_api_client/models/__init__.py,sha256=AMlb9R9O9aNC9hvKz_8TFpEfOolYC3VtFS5JX17kYks,4888
|
|
21
|
-
lyceum_cli-1.0.
|
|
22
|
-
lyceum_cli-1.0.
|
|
23
|
-
lyceum_cli-1.0.
|
|
24
|
-
lyceum_cli-1.0.
|
|
25
|
-
lyceum_cli-1.0.
|
|
21
|
+
lyceum_cli-1.0.19.dist-info/METADATA,sha256=1aNxetYl8dR0qpQSNK05hTLS2fdTmoCLwdaeu93D8V8,1482
|
|
22
|
+
lyceum_cli-1.0.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
+
lyceum_cli-1.0.19.dist-info/entry_points.txt,sha256=Oq-9wDkxVd6MHgNiUTYwXI9SGhvR3VkD7Mvk0xhiUZo,43
|
|
24
|
+
lyceum_cli-1.0.19.dist-info/top_level.txt,sha256=CR7FEMloAXgLsHUR6ti3mWNcpgje27HRHSfq8doIils,41
|
|
25
|
+
lyceum_cli-1.0.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|