OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  llmwhisperer:使用 LLMWhisperer 从图像和 PDF 中提取文本与布局信息

llmwhisperer:使用 LLMWhisperer 从图像和 PDF 中提取文本与布局信息

 
  protocol ·  2026-02-05 23:36:29 · 3 次点击  · 0 条评论  

名称: llmwhisperer
描述: 使用 LLMWhisperer API 从图像和 PDF 中提取文本与布局。擅长处理手写内容和复杂表格。
元数据: {"clawdbot":{"emoji":"📄","scripts":["scripts/llmwhisperer"]}}


LLMWhisperer

使用 LLMWhisperer API 从图像和 PDF 中提取文本与布局,尤其适用于手写内容和复杂表格。

配置

需要在 ~/.clawdbot/.env 文件中设置 LLMWHISPERER_API_KEY 环境变量:

echo "LLMWHISPERER_API_KEY=your_key_here" >> ~/.clawdbot/.env

获取 API 密钥

访问 unstract.com/llmwhisperer 获取免费 API 密钥。
- 免费额度: 每天 100 页

使用方法

llmwhisperer <文件路径>

脚本源码

可执行脚本位于 scripts/llmwhisperer

#!/bin/bash
# 使用 LLMWhisperer API 提取文本

if [ -z "$LLMWHISPERER_API_KEY" ]; then
  if [ -f ~/.clawdbot/.env ]; then
    # shellcheck disable=SC2046
    export $(grep -v '^#' ~/.clawdbot/.env | grep 'LLMWHISPERER_API_KEY' | xargs)
  fi
fi

if [ -z "$LLMWHISPERER_API_KEY" ]; then
  echo "错误:在环境变量或 ~/.clawdbot/.env 中未找到 LLMWHISPERER_API_KEY"
  exit 1
fi

FILE="$1"
if [ -z "$FILE" ]; then
  echo "用法:$0 <文件路径>"
  exit 1
fi

curl -s -X POST "https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper?mode=high_quality&output_mode=layout_preserving" \
  -H "Content-Type: application/octet-stream" \
  -H "unstract-key: $LLMWHISPERER_API_KEY" \
  --data-binary "@$FILE"

使用示例

将提取的文本输出到终端:

llmwhisperer flyer.jpg

将输出保存到文本文件:

llmwhisperer invoice.pdf > invoice.txt

处理手写笔记:

llmwhisperer notes.jpg
3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor