Files
page-agent/pages/docs/features/model-integration/page.tsx
2025-09-29 16:33:15 +08:00

163 lines
6.4 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import BetaNotice from '@pages/components/BetaNotice'
import CodeEditor from '@pages/components/CodeEditor'
export default function ModelIntegration() {
return (
<div>
<h1 className="text-4xl font-bold mb-6"></h1>
<BetaNotice />
<p className="text-xl text-gray-600 dark:text-gray-300 mb-6 leading-relaxed">
OpenAI tool call
</p>
<h2 className="text-2xl font-bold mb-3"></h2>
<div className="p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg mb-6">
<h3 className="text-lg font-semibold mb-2 text-blue-900 dark:text-blue-300">
🔌 OpenAI
</h3>
<p className="text-foreground/80">
OpenAI API chat/completions OpenAIAzure
使 vLLMOllama
</p>
<p className="text-foreground/80">
tool call json schema tool call
</p>
</div>
<h2 className="text-2xl font-bold mb-3"></h2>
<div className="grid md:grid-cols-3 gap-4 mb-6">
<div className="p-4 bg-green-50 dark:bg-green-900/20 rounded-lg">
<h3 className="text-lg font-semibold mb-2 text-green-900 dark:text-green-300">
gpt-4.1-mini
</h3>
<p className="text-sm text-foreground/80 mb-2">使 </p>
<ul className="text-sm text-foreground/70 space-y-1">
<li> </li>
<li> </li>
<li> i/o $0.4/$1.6 ( M token)</li>
</ul>
</div>
<div className="p-4 bg-purple-50 dark:bg-purple-900/20 rounded-lg">
<h3 className="text-lg font-semibold mb-2 text-purple-900 dark:text-purple-300">
🚀 gpt-4.1
</h3>
<p className="text-sm text-foreground/80 mb-2"></p>
<ul className="text-sm text-foreground/70 space-y-1">
<li> </li>
<li> 4.1-mini 5 </li>
<li> </li>
</ul>
</div>
<div className="p-4 bg-orange-50 dark:bg-orange-900/20 rounded-lg">
<h3 className="text-lg font-semibold mb-2 text-orange-900 dark:text-orange-300">
🛡 qwen-plus (qwen3)
</h3>
<p className="text-sm text-foreground/80 mb-2"></p>
<ul className="text-sm text-foreground/70 space-y-1">
<li> 便</li>
<li> ToolCall </li>
<li>
<strong></strong>
</li>
</ul>
</div>
</div>
<h2 className="text-2xl font-bold mb-3"></h2>
<div className="p-4 bg-emerald-50 dark:bg-emerald-900/20 rounded-lg mb-6">
<h3 className="text-lg font-semibold mb-3 text-emerald-900 dark:text-emerald-300">
</h3>
<div className="flex flex-wrap gap-2">
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
gpt-4.1-mini
</span>
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
gpt-4.1
</span>
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
gpt-5
</span>
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
gpt-5-mini
</span>
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
qwen-plus
</span>
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
deepseek-v3.1
</span>
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
claude-4-sonnet
</span>
<span className="inline-flex items-center rounded-full bg-emerald-100 dark:bg-emerald-900/40 text-emerald-900 dark:text-emerald-200 px-3 py-1 text-sm">
claude-3.7-sonnet
</span>
</div>
</div>
<h2 className="text-2xl font-bold mb-3"></h2>
<div className="p-4 bg-red-50 dark:bg-red-900/20 rounded-lg mb-6">
<h3 className="text-lg font-semibold mb-2 text-red-900 dark:text-red-300">
🚫
</h3>
<ul className="text-sm text-foreground/80 space-y-1 list-disc pl-5">
<li>reasoning </li>
<li>GPT-5 </li>
<li> agent coder </li>
<li>
json schema openAI tool call
</li>
<li>nano </li>
<li>Gemini OpenAI tool call </li>
</ul>
</div>
<h2 className="text-2xl font-bold mb-3"></h2>
<CodeEditor
code={`
// 百炼等其他兼容服务
const pageAgent = new PageAgent({
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'your-api-key',
modelName: 'qwen-plus'
});
// 私有部署模型
const pageAgent = new PageAgent({
baseURL: 'http://localhost:11434/v1',
apiKey: 'ollama', // Ollama 通常使用任意值
modelName: 'qwen3:latest'
});`}
/>
<div className="mt-6 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-lg">
<h3 className="text-lg font-semibold mb-2 text-yellow-900 dark:text-yellow-300">
💡
</h3>
<ul className="text-sm text-foreground/80 space-y-2">
<li>
<strong>baseURL</strong>: API OpenAI
</li>
<li>
<strong>apiKey</strong>: API
</li>
<li>
<strong>modelName</strong>: gpt-4.1-mini
</li>
</ul>
</div>
</div>
)
}