Skip to content

Commit 8436739

Browse files
committed
feat: Support interactive OAuth servers in the Typescript chatbot
1 parent f8f6237 commit 8436739

File tree

2 files changed

+545
-0
lines changed

2 files changed

+545
-0
lines changed

examples/chatbots/typescript/src/main.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { ChatSession } from "./chat_session.js";
33
import { LLMClient } from "./llm_client.js";
44
import { StdioServer } from "./server_clients/stdio_server.js";
55
import { LambdaFunctionClient } from "./server_clients/lambda_function.js";
6+
import {
7+
InteractiveOAuthClient,
8+
InteractiveOAuthConfig,
9+
} from "./server_clients/interactive_oauth.js";
610
import { Server } from "./server_clients/server.js";
711
import logger from "./logger.js";
812

@@ -29,6 +33,15 @@ async function main(): Promise<void> {
2933
);
3034
}
3135

36+
// Initialize interactive OAuth servers
37+
for (const [name, srvConfig] of Object.entries(
38+
serverConfig.oAuthServers || {}
39+
)) {
40+
servers.push(
41+
new InteractiveOAuthClient(name, srvConfig as InteractiveOAuthConfig)
42+
);
43+
}
44+
3245
const llmClient = new LLMClient(config.bedrockClient, config.modelId);
3346
const chatSession = new ChatSession(servers, llmClient);
3447

0 commit comments

Comments
 (0)