Skip to content

Commit

Permalink
🧑‍💻 chore: add console
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Aug 19, 2023
1 parent b54b96f commit 989470e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/v1/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export default async (req: Request) => {

const indexRes = await fetch(INDEX_URL);
const manifest: LobeChatPluginsMarketIndex = await indexRes.json();
console.log('manifest:', manifest);
console.info('manifest:', manifest);

const { name, arguments: args } = (await req.json()) as OpenAIPluginPayload;

console.log(`检测到 functionCall: ${name}`);
console.info(`plugin call: ${name}`);

const item = manifest.plugins.find((i) => i.name === name);

Expand All @@ -28,6 +28,7 @@ export default async (req: Request) => {
// 获取插件的 manifest
const pluginRes = await fetch(item.manifest);
const chatPlugin = (await pluginRes.json()) as LobeChatPlugin;
console.log(`[${name}] plugin manifest:`, chatPlugin);

const response = await fetch(chatPlugin.server.url, { body: args, method: 'post' });

Expand Down

0 comments on commit 989470e

Please sign in to comment.