forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
20 lines (17 loc) · 746 Bytes
/
Copy pathindex.ts
File metadata and controls
20 lines (17 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
* Import function triggers from their respective submodules:
*
* import {onCall} from "firebase-functions/v2/https";
* import {onDocumentWritten} from "firebase-functions/v2/firestore";
*
* See a full list of supported triggers at https://firebase.google.com/docs/functions
*/
import { onRequest } from "firebase-functions/v2/https";
// import * as logger from "firebase-functions/logger";
import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";
// Start writing functions
// https://firebase.google.com/docs/functions/typescript
export const copilotKit = onRequest((request, response) => {
const copilotKit = new CopilotRuntime();
copilotKit.streamHttpServerResponse(request, response, new OpenAIAdapter({}));
});