mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(cli): support image describe urls (#82854)
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -1097,10 +1097,12 @@ async function runImageDescribe(params: {
|
||||
const prompt = normalizeOptionalString(params.prompt);
|
||||
const outputs = await Promise.all(
|
||||
params.files.map(async (filePath) => {
|
||||
const resolvedPath = path.resolve(filePath);
|
||||
const isRemoteUrl = /^https?:\/\//i.test(filePath.trim());
|
||||
const resolvedPath = isRemoteUrl ? filePath.trim() : path.resolve(filePath);
|
||||
const result = activeModel
|
||||
? await describeImageFileWithModel({
|
||||
filePath: resolvedPath,
|
||||
...(isRemoteUrl ? { mediaUrl: resolvedPath } : {}),
|
||||
cfg,
|
||||
agentDir,
|
||||
provider: activeModel.provider,
|
||||
@@ -1110,6 +1112,7 @@ async function runImageDescribe(params: {
|
||||
})
|
||||
: await describeImageFile({
|
||||
filePath: resolvedPath,
|
||||
...(isRemoteUrl ? { mediaUrl: resolvedPath } : {}),
|
||||
cfg,
|
||||
agentDir,
|
||||
prompt,
|
||||
|
||||
Reference in New Issue
Block a user