Hướng dẫn Claude Code
Thiết lập model Claude của Flaq AI và khám phá kỹ năng Claude Code
Dùng thử Claude Fable 5.1 API của Anthropic để phân tích tài liệu phức tạp, biểu đồ trong PDF, bảng và sơ đồ qua API Flaq AI ổn định cho công việc tri thức phức tạp.
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
Accept: 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'claude-fable-5.1-file-analysis',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'Summarize this file and extract the key risks.' },
{
type: 'file',
file: {
filename: 'demo.pdf',
file_data: 'https://example.com/demo.pdf'
}
}
]
}
],
stream: true,
max_tokens: 4096
})
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = '';
let assistantText = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
buffer += decoder.decode(value, { stream: true });
const frames = buffer.split('\n\n');
buffer = frames.pop() || '';
for (const frame of frames) {
const lines = frame.split('\n').filter(Boolean);
let eventName = 'message';
const dataLines = [];
for (const line of lines) {
if (line.startsWith('event:')) {
eventName = line.slice(6).trim();
} else if (line.startsWith('data:')) {
dataLines.push(line.replace(/^data:\s*/, ''));
}
}
const raw = dataLines.join('\n').trim();
if (raw === '[DONE]') {
console.log('\nFinal text:', assistantText);
continue;
}
let payload;
try {
payload = JSON.parse(raw);
} catch {
continue;
}
if (eventName === 'error' || payload.error) {
const msg = payload.error?.message ?? payload.message ?? 'Chat request failed';
throw new Error(msg);
}
const delta = payload.choices?.[0]?.delta;
if (delta?.content) {
assistantText += delta.content;
console.log(assistantText);
}
}
}
import json
import requests
response = requests.post(
'https://api.flaq.ai/api/v1/chat/completions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json',
},
json={
'model': 'claude-fable-5.1-file-analysis',
'messages': [
{
'role': 'user',
'content': [
{'type': 'text', 'text': 'Summarize this file and extract the key risks.'},
{
'type': 'file',
'file': {
'filename': 'demo.pdf',
'file_data': 'https://example.com/demo.pdf',
},
},
],
}
],
'stream': True,
'max_tokens': 4096,
},
stream=True,
)
response.raise_for_status()
event_name = 'message'
assistant_text = ''
for raw_line in response.iter_lines(decode_unicode=True):
if not raw_line:
event_name = 'message'
continue
if raw_line.startswith('event:'):
event_name = raw_line.replace('event:', '', 1).strip()
continue
if raw_line.startswith('data:'):
raw_data = raw_line.replace('data:', '', 1).strip()
if raw_data == '[DONE]':
print('\nFinal text:', assistant_text)
continue
payload = json.loads(raw_data)
if event_name == 'error' or payload.get('error'):
error = payload.get('error') or payload
raise RuntimeError(error.get('message', 'Chat request failed'))
choices = payload.get('choices') or []
if choices:
delta = choices[0].get('delta') or {}
content = delta.get('content')
if content:
assistant_text += content
print(content, end='', flush=True)
curl -N -X POST "https://api.flaq.ai/api/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: text/event-stream" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-fable-5.1-file-analysis",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Summarize this file and extract the key risks." },
{
"type": "file",
"file": {
"filename": "demo.pdf",
"file_data": "https://example.com/demo.pdf"
}
}
]
}
],
"stream": true,
"max_tokens": 4096
}'
| Tham số | Giá | Giá gốc | Giảm giá |
|---|
Claude Fable 5.1 File Analysis API áp dụng mô hình thuộc dòng Fable hiện tại của Anthropic cho các tệp PDF phức tạp và tài liệu chuyên môn trên Flaq AI, đặc biệt mạnh trong việc đọc biểu đồ, bảng và sơ đồ được lồng trong tài liệu. Việc tích hợp API phân tích tệp này giúp các nhà phát triển và nhóm chuyên môn rút ra ý nghĩa từ tài liệu, hình ảnh được hỗ trợ và hướng dẫn bằng văn bản tùy chọn.
Lưu ý Đảm bảo tệp tải lên và câu lệnh tuân thủ chính sách sử dụng của Anthropic, điều khoản của Flaq AI và quy tắc xử lý dữ liệu của bạn. Nếu xảy ra lỗi, hãy kiểm tra nội dung không được hỗ trợ hoặc bị hạn chế, đơn giản hóa hướng dẫn rồi thử lại.
Claude Fable 5.1 so với Claude Fable 5 File Analysis
Claude Fable 5 File Analysis là mô hình xử lý tài liệu của thế hệ Fable trước và vẫn hữu ích cho các nhóm đang sử dụng thế hệ đó. Claude Fable 5.1 là lựa chọn thuộc dòng Fable hiện tại khi biểu đồ, bảng và sơ đồ lồng trong PDF là trọng tâm công việc.
Claude Fable 5.1 so với GPT 6 Astra File Analysis
GPT 6 Astra File Analysis là mô hình xử lý tài liệu chủ lực hiện tại từ OpenAI, phục vụ suy luận phức tạp và tổng hợp thông tin giữa nhiều tệp. Claude Fable 5.1 File Analysis API là phương án từ Anthropic, chú trọng rõ hơn vào việc đọc cấu trúc trực quan bên trong PDF.
Claude Fable 5.1 so với GPT 5.6 Sol File Analysis
GPT 5.6 Sol File Analysis là mô hình xử lý tài liệu chủ lực thế hệ trước từ OpenAI trên Flaq AI. Claude Fable 5.1 cung cấp một lựa chọn Anthropic hiện tại cho công việc tri thức sử dụng nhiều tài liệu, đặc biệt khi hình minh họa bên trong PDF đóng vai trò quan trọng.
Claude Fable 5.1 so với Gemini File Understanding
Quy trình xử lý tệp của Gemini phù hợp với các sản phẩm đa phương thức lấy Google làm trung tâm. Claude Fable 5.1 File Analysis API dành cho các nhóm muốn sử dụng khả năng hiểu tài liệu cấp Fable của Anthropic thông qua Flaq AI.
Thiết lập model Claude của Flaq AI và khám phá kỹ năng Claude Code

Thiết lập model GPT của Flaq AI và khám phá kỹ năng Codex
Dùng mô hình LLM của Flaq AI trong Hermes Agent
Sử dụng GLM 5.2, Kimi K3 và DeepSeek v4 trong ZCode
Chạy DeepSeek Harness với các mô hình DeepSeek của Flaq AI
Kết nối các tác nhân AI với công cụ tạo hình ảnh và video của Flaq
Sử dụng GPT 6 Astra và Claude Fable 5.1 trong WorkBuddy