Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,131 +93,150 @@ const sidebar = [
link: '/',
translations: {
ja: '概要',
ko: '개요',
},
},
{
label: 'Quickstart',
link: '/guides/quickstart',
translations: {
ja: 'クイックスタート',
ko: '빠른 시작',
},
},
{
label: 'Guides',
translations: {
ja: 'ガイド',
ko: '가이드',
},
items: [
{
label: 'Agents',
link: '/guides/agents',
translations: {
ja: 'エージェント',
ko: '에이전트',
},
},
{
label: 'Running Agents',
link: '/guides/running-agents',
translations: {
ja: 'エージェントの実行',
ko: '에이전트 실행',
},
},
{
label: 'Results',
link: '/guides/results',
translations: {
ja: 'エージェントの実行結果',
ko: '에이전트 실행 결과',
},
},
{
label: 'Tools',
link: '/guides/tools',
translations: {
ja: 'ツール',
ko: '도구',
},
},
{
label: 'Orchestrating multiple agents',
link: '/guides/multi-agent',
translations: {
ja: 'マルチエージェント',
ko: '멀티 에이전트 오케스트레이션',
},
},
{
label: 'Handoffs',
link: '/guides/handoffs',
translations: {
ja: 'ハンドオフ',
ko: '핸드오프',
},
},
{
label: 'Context management',
link: '/guides/context',
translations: {
ja: 'コンテキスト管理',
ko: '컨텍스트 관리',
},
},
{
label: 'Models',
link: '/guides/models',
translations: {
ja: 'モデル',
ko: '모델',
},
},
{
label: 'Guardrails',
link: '/guides/guardrails',
translations: {
ja: 'ガードレール',
ko: '가드레일',
},
},
{
label: 'Streaming',
link: '/guides/streaming',
translations: {
ja: 'ストリーミング',
ko: '스트리밍',
},
},
{
label: 'Human-in-the-loop',
link: '/guides/human-in-the-loop',
translations: {
ja: '人間の介入(HITL)',
ko: '휴먼인더루프 (HITL)',
},
},
{
label: 'Model Context Protocol (MCP)',
link: '/guides/mcp',
translations: {
ja: 'MCP 連携',
ko: '모델 컨텍스트 프로토콜 (MCP)',
},
},
{
label: 'Tracing',
link: '/guides/tracing',
translations: {
ja: 'トレーシング',
ko: '트레이싱',
},
},
{
label: 'Configuring the SDK',
link: '/guides/config',
translations: {
ja: 'SDK の設定',
ko: 'SDK 구성',
},
},
{
label: 'Troubleshooting',
link: '/guides/troubleshooting',
translations: {
ja: 'トラブルシューティング',
ko: '문제 해결',
},
},
{
label: 'Release process',
link: '/guides/release',
translations: {
ja: 'リリースプロセス',
ko: '릴리스 프로세스',
},
},
],
Expand All @@ -226,34 +245,39 @@ const sidebar = [
label: 'Voice Agents',
translations: {
ja: '音声エージェント',
ko: '음성 에이전트',
},
items: [
{
label: 'Overview',
link: '/guides/voice-agents',
translations: {
ja: '音声エージェントの概要',
ko: '개요',
},
},
{
label: 'Quickstart',
link: '/guides/voice-agents/quickstart',
translations: {
ja: 'クイックスタート',
ko: '빠른 시작',
},
},
{
label: 'Building Voice Agents',
link: '/guides/voice-agents/build',
translations: {
ja: '音声エージェントの構築',
ko: '음성 에이전트 구축',
},
},
{
label: 'Transport Mechanisms',
link: '/guides/voice-agents/transport',
translations: {
ja: 'リアルタイムトランスポート',
ko: '전송 메커니즘',
},
},
],
Expand All @@ -262,20 +286,23 @@ const sidebar = [
label: 'Extensions',
translations: {
ja: '拡張機能',
ko: '확장 기능',
},
items: [
{
label: 'Use any model with the AI SDK',
link: '/extensions/ai-sdk',
translations: {
ja: 'AI SDK で任意モデルを指定',
ko: 'AI SDK로 임의 모델 사용',
},
},
{
label: 'Connect Realtime Agents to Twilio',
link: '/extensions/twilio',
translations: {
ja: 'Realtime Agent を Twilio に接続',
ko: 'Twilio와 실시간 에이전트 사용',
},
},
],
Expand All @@ -284,6 +311,7 @@ const sidebar = [
label: 'API Reference',
translations: {
ja: 'APIリファレンス',
ko: 'API 레퍼런스',
},
collapsed: false,
items: [
Expand Down Expand Up @@ -346,6 +374,10 @@ export default defineConfig({
label: '日本語',
lang: 'ja',
},
ko: {
label: '한국어',
lang: 'ko',
},
},
social: [
{
Expand Down
83 changes: 83 additions & 0 deletions docs/src/content/docs/ko/extensions/ai-sdk.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: AI SDK로 임의 모델 사용
description: Connect your Agents SDK agents to any model through the Vercel's AI SDK
---

import { Aside, Steps, Code } from '@astrojs/starlight/components';
import aiSdkSetupExample from '../../../../../../examples/docs/extensions/ai-sdk-setup.ts?raw';

<Aside type="caution">
이 어댑터는 아직 베타 단계입니다. 특히 규모가 작은 일부 모델 제공자와 함께
사용할 때 문제가 발생할 수 있습니다. 문제가 있으면 [GitHub
이슈](https://github.com/openai/openai-agents-js/issues)로 보고해 주세요.
신속히 수정하겠습니다.
</Aside>

기본적으로 Agents SDK는 Responses API 또는 Chat Completions API를 통해 OpenAI 모델과 함께 작동합니다. 하지만 다른 모델을 사용하려면, [Vercel의 AI SDK](https://sdk.vercel.ai/)에서 지원하는 다양한 모델을 이 어댑터를 통해 Agents SDK에 연결할 수 있습니다.

## 설정

<Steps>

1. 확장 패키지를 설치하여 AI SDK 어댑터를 설치하세요:

```bash
npm install @openai/agents-extensions
```

2. [Vercel의 AI SDK](https://sdk.vercel.ai/docs/models/overview)에서 원하는 모델 패키지를 선택하여 설치하세요:

```bash
npm install @ai-sdk/openai@"^1.0.0"
```

3. 어댑터와 모델을 가져와 에이전트에 연결하세요:

```typescript
import { openai } from '@ai-sdk/openai';
import { aisdk } from '@openai/agents-extensions';
```

4. 에이전트가 사용할 모델 인스턴스를 초기화하세요:

```typescript
const model = aisdk(openai('o4-mini'));
```

</Steps>

<Aside type="caution">
Vercel의 AI SDK는 최근 v2로 마이그레이션되었지만, openai agent
extensions(OpenAI Agents SDK 확장)은 아직 v2와 호환되지 않습니다. 따라서
Vercel의 AI SDK는 v1 버전을 설치해야 합니다.
</Aside>

## 예시

<Code lang="typescript" code={aiSdkSetupExample} title="AI SDK 설정" />

## 프로바이더 메타데이터 전달

메시지와 함께 프로바이더별 옵션을 전송해야 하는 경우 `providerMetadata`를 통해 전달하세요. 값은 기저 AI SDK 모델로 직접 전달됩니다. 예를 들어, Agents SDK에서 다음과 같은 `providerData`는

```ts
providerData: {
anthropic: {
cacheControl: {
type: 'ephemeral';
}
}
}
```

AI SDK 통합을 사용할 때 다음과 같이 변환됩니다

```ts
providerMetadata: {
anthropic: {
cacheControl: {
type: 'ephemeral';
}
}
}
```
Loading