Claude Code 指南
配置 Flaq AI Claude 模型并探索 Claude Code 技能
通过 Flaq AI 稳定、实惠且支持流式响应的 API,体验 OpenAI GPT 6.1 Sol API 的文件分析、文档摘要和文件问答能力。围绕文档内容提问并提炼摘要,辅助日常阅读与分析。
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: 'gpt-6.1-sol-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
})
});
if (!response.ok) {
const errorBody = await response.json().catch(() => null);
throw new Error(errorBody?.error?.message ?? errorBody?.message ?? `HTTP ${response.status}`);
}
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(/\r?\n\r?\n/);
buffer = frames.pop() || '';
for (const frame of frames) {
const lines = frame.split(/\r?\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': 'gpt-6.1-sol-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": "gpt-6.1-sol-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
}'
| 参数 | 价格 | 原价 | 折扣 |
|---|
GPT 6.1 Sol File Analysis API 让开发者能够在 Flaq AI 上构建文档问答和审阅工作流。提供 受支持的文件、图片以及可选的指令,即可请求对所提供材料进行文字分析。无论 任务是报告摘要、参考文档对比,还是特定段落的解释,此 API 均提供 对话式交互、流式传输和输出长度控制。
基于附件的分析: 直接处理受支持的文件,将问题与其 来源材料结合起来考量。
文档摘要: 请求报告概述、逐节简报,或面向 特定受众的摘要。
定向信息请求: 询问相关细节或解释,并指定回答的 组织方式。
相关文件对比: 同时提供多份文档,探索差异、共同主题,或值得 进一步审阅的问题。
图片和文字背景: 当有助于说明需要在文件中查找什么时,添加受支持的视觉参考 和文字指令。
带输出控制的流式响应: 逐步显示文字分析,并使用输出 token 上限来管理 回答范围。
输入: 受支持的文件或图片附件、可选的文字指令,以及相关对话消息。
输出: 关于所提供内容的文字摘要、解释、对比或回答。
控制项: 问题重点、要求的回答结构、可选的输出 token 上限,以及是否使用流式响应。
能力: 文档审阅、基于文件的问答、摘要,以及针对所提供的多份 参考资料进行分析。
业务报告摘要: 将上传的报告转化为工作简报,突出与 团队相关的章节。
规范审阅: 针对项目文档提问,并收集需要澄清的要点。
研究整理: 将所提供阅读材料中的发现归纳成结构化概述。
文档助手: 让用户针对对话中附加的文件继续追问。
编辑素材审阅: 为草稿提取主题和支撑材料,同时保留原始文档 以供核查。
注意 请提供清晰可读的文件,并明确要询问的问题。使用输出前,请对照源文档 核实引文、提取的数值和结论。
GPT 6.1 Sol File Analysis 与 Claude Sonnet 5.5 File Analysis 两个接口均支持在 Flaq AI 上输入文档和图片。对比它们对相同文件的解读,选择适合审阅工作流的接口。
GPT 6.1 Sol File Analysis 与 GPT 6.1 Sol Text-to-Text Text-to-Text 接收文字消息,不包含文件 附件。File Analysis 适用于以上传文档作为参考材料的任务。
GPT 6.1 Sol File Analysis 与 GPT 6.1 Sol Image-to-Text Image-to-Text 的当前配置处理视觉问题,不包含文档 附件。File Analysis 支持将文档与视觉背景一起使用。
GPT 6.1 Sol File Analysis 与 GPT 6.1 Sol Web Search Web Search 支持在线研究。File Analysis 则使 工作流围绕所提供的附件展开,不启用网页搜索。
配置 Flaq AI Claude 模型并探索 Claude Code 技能

配置 Flaq AI GPT 模型并探索 Codex 技能
在 Hermes Agent 中使用 Flaq AI LLM 模型
在 ZCode 中使用 GLM 5.2、Kimi K3 和 DeepSeek v4
使用 Flaq AI DeepSeek 模型运行 DeepSeek Harness
将 AI 智能体连接到 Flaq 图像和视频生成工具
在 WorkBuddy 中使用 GPT 6 Astra 和 Claude Fable 5.1