MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / createStrategyHandlers

Method createStrategyHandlers

ai/ai.ts:2633–2757  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2631
2632 private createStrategyHandlers(): Record<ProviderStrategy, StrategyHandler> {
2633 return {
2634 "openai-rest": {
2635 chat: async (ctx) =>
2636 this.callOpenAIChatOrSearch(
2637 ctx.providerConfig,
2638 ctx.model,
2639 ctx.question,
2640 ctx.images,
2641 ctx.modeConfig,
2642 ctx.config.prompt || "",
2643 ctx.token,
2644 ),
2645 search: async (ctx) =>
2646 this.callOpenAIChatOrSearch(
2647 ctx.providerConfig,
2648 ctx.model,
2649 ctx.question,
2650 ctx.images,
2651 ctx.modeConfig,
2652 ctx.config.prompt || "",
2653 ctx.token,
2654 true,
2655 ),
2656 image: async (ctx) =>
2657 this.generateImageWithOpenAIRest(
2658 ctx.providerConfig,
2659 ctx.model,
2660 ctx.prompt,
2661 ctx.image,
2662 ctx.modeConfig,
2663 ctx.token,
2664 ),
2665 video: async (ctx) =>
2666 this.generateVideoWithOpenAIRest(
2667 ctx.providerConfig,
2668 ctx.model,
2669 ctx.prompt,
2670 ctx.images,
2671 ctx.imageMode,
2672 ctx.modeConfig,
2673 ctx.token,
2674 ),
2675 },
2676 "gemini-rest": {
2677 chat: async (ctx) =>
2678 this.callGeminiChatOrSearch(
2679 ctx.providerConfig,
2680 ctx.model,
2681 ctx.question,
2682 ctx.images,
2683 ctx.modeConfig,
2684 ctx.config.prompt || "",
2685 ctx.token,
2686 ),
2687 search: async (ctx) =>
2688 this.callGeminiChatOrSearch(
2689 ctx.providerConfig,
2690 ctx.model,

Callers 1

constructorMethod · 0.95

Tested by

no test coverage detected