@genui-a3/create 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/template/app/api/agui/route.ts +2 -2
- package/template/app/api/chat/route.ts +2 -2
- package/template/app/api/stream/route.ts +2 -2
- package/template/app/lib/providers/anthropic.ts +10 -3
- package/template/app/lib/providers/bedrock.ts +10 -3
- package/template/app/lib/providers/openai.ts +8 -1
package/dist/index.js
CHANGED
|
@@ -14,9 +14,9 @@ import fs from "fs-extra";
|
|
|
14
14
|
|
|
15
15
|
// src/utils/providers.ts
|
|
16
16
|
var PROVIDER_META = {
|
|
17
|
-
openai: { label: "OpenAI", exportName: "
|
|
18
|
-
bedrock: { label: "AWS Bedrock", exportName: "
|
|
19
|
-
anthropic: { label: "Anthropic", exportName: "
|
|
17
|
+
openai: { label: "OpenAI", exportName: "getOpenAIProvider", file: "openai.ts" },
|
|
18
|
+
bedrock: { label: "AWS Bedrock", exportName: "getBedrockProvider", file: "bedrock.ts" },
|
|
19
|
+
anthropic: { label: "Anthropic", exportName: "getAnthropicProvider", file: "anthropic.ts" }
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// src/utils/generators.ts
|
|
@@ -35,7 +35,7 @@ function generateProviderFiles(targetDir, config) {
|
|
|
35
35
|
const baseName = meta.file.replace(".ts", "");
|
|
36
36
|
lines.push(`export { ${meta.exportName} } from './${baseName}'`);
|
|
37
37
|
}
|
|
38
|
-
lines.push(`export { ${primaryMeta.exportName} as
|
|
38
|
+
lines.push(`export { ${primaryMeta.exportName} as getProvider } from './${primaryMeta.file.replace(".ts", "")}'`);
|
|
39
39
|
lines.push("");
|
|
40
40
|
fs.outputFileSync(path.join(providersDir, "index.ts"), lines.join("\n"));
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { NextRequest } from 'next/server'
|
|
|
2
2
|
import { EventType, type RunAgentInput } from '@ag-ui/client'
|
|
3
3
|
import { EventEncoder } from '@ag-ui/encoder'
|
|
4
4
|
import { AgentRegistry, ChatSession, MemorySessionStore, AGUIAgent } from '@genui-a3/core'
|
|
5
|
-
import {
|
|
5
|
+
import { getProvider } from '../../lib/providers'
|
|
6
6
|
import { greetingAgent, State } from '../../agents/greeting'
|
|
7
7
|
import { ageAgent } from '../../agents/age'
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ const a3Agent = new AGUIAgent({
|
|
|
23
23
|
sessionId: input.threadId,
|
|
24
24
|
store,
|
|
25
25
|
initialAgentId: 'greeting',
|
|
26
|
-
provider,
|
|
26
|
+
provider: getProvider(),
|
|
27
27
|
}),
|
|
28
28
|
})
|
|
29
29
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { NextRequest, NextResponse } from 'next/server'
|
|
7
7
|
import { AgentRegistry, ChatSession, MemorySessionStore } from '@genui-a3/core'
|
|
8
|
-
import {
|
|
8
|
+
import { getProvider } from '../../lib/providers'
|
|
9
9
|
import { greetingAgent, State } from '../../agents/greeting'
|
|
10
10
|
import { ageAgent } from '../../agents/age'
|
|
11
11
|
|
|
@@ -36,7 +36,7 @@ export async function POST(request: NextRequest) {
|
|
|
36
36
|
store,
|
|
37
37
|
initialAgentId: 'greeting',
|
|
38
38
|
initialState: { userName: undefined },
|
|
39
|
-
provider,
|
|
39
|
+
provider: getProvider(),
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
const result = await session.send({ message })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server'
|
|
2
2
|
import { AgentRegistry, ChatSession, MemorySessionStore } from '@genui-a3/core'
|
|
3
|
-
import {
|
|
3
|
+
import { getProvider } from '../../lib/providers'
|
|
4
4
|
import { greetingAgent, State } from '../../agents/greeting'
|
|
5
5
|
import { ageAgent } from '../../agents/age'
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ export async function POST(request: NextRequest) {
|
|
|
31
31
|
store,
|
|
32
32
|
initialAgentId: 'greeting',
|
|
33
33
|
initialState: { userName: undefined },
|
|
34
|
-
provider,
|
|
34
|
+
provider: getProvider(),
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
const encoder = new TextEncoder()
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { createAnthropicProvider } from '@genui-a3/providers/anthropic'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
let _instance: ReturnType<typeof createAnthropicProvider> | null = null
|
|
4
|
+
|
|
5
|
+
export function getAnthropicProvider() {
|
|
6
|
+
if (!_instance) {
|
|
7
|
+
_instance = createAnthropicProvider({
|
|
8
|
+
models: ['claude-sonnet-4-5-20250929', 'claude-haiku-4-5-20251001'],
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
return _instance
|
|
12
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { createBedrockProvider } from '@genui-a3/providers/bedrock'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
let _instance: ReturnType<typeof createBedrockProvider> | null = null
|
|
4
|
+
|
|
5
|
+
export function getBedrockProvider() {
|
|
6
|
+
if (!_instance) {
|
|
7
|
+
_instance = createBedrockProvider({
|
|
8
|
+
models: ['us.anthropic.claude-sonnet-4-5-20250929-v1:0', 'us.anthropic.claude-haiku-4-5-20251001-v1:0'],
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
return _instance
|
|
12
|
+
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { createOpenAIProvider } from '@genui-a3/providers/openai'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
let _instance: ReturnType<typeof createOpenAIProvider> | null = null
|
|
4
|
+
|
|
5
|
+
export function getOpenAIProvider() {
|
|
6
|
+
if (!_instance) {
|
|
7
|
+
_instance = createOpenAIProvider({ models: ['gpt-4o', 'gpt-4o-mini'] })
|
|
8
|
+
}
|
|
9
|
+
return _instance
|
|
10
|
+
}
|