mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Interface cleanup
This commit is contained in:
@@ -4,7 +4,7 @@ import OpenAI from "openai"
|
|||||||
import { ApiHandler } from "../"
|
import { ApiHandler } from "../"
|
||||||
import { ApiHandlerOptions, ModelInfo, openRouterDefaultModelId, openRouterDefaultModelInfo } from "../../shared/api"
|
import { ApiHandlerOptions, ModelInfo, openRouterDefaultModelId, openRouterDefaultModelInfo } from "../../shared/api"
|
||||||
import { convertToOpenAiMessages } from "../transform/openai-format"
|
import { convertToOpenAiMessages } from "../transform/openai-format"
|
||||||
import { ApiStream, ApiStreamChunk, ApiStreamUsageChunk } from "../transform/stream"
|
import { ApiStreamChunk, ApiStreamUsageChunk } from "../transform/stream"
|
||||||
import delay from "delay"
|
import delay from "delay"
|
||||||
|
|
||||||
// Add custom interface for OpenRouter params
|
// Add custom interface for OpenRouter params
|
||||||
@@ -17,10 +17,7 @@ interface OpenRouterApiStreamUsageChunk extends ApiStreamUsageChunk {
|
|||||||
fullResponseText: string;
|
fullResponseText: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface for providers that support single completions
|
import { SingleCompletionHandler } from ".."
|
||||||
export interface SingleCompletionHandler {
|
|
||||||
completePrompt(prompt: string): Promise<string>
|
|
||||||
}
|
|
||||||
|
|
||||||
export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
|
export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
|
||||||
private options: ApiHandlerOptions
|
private options: ApiHandlerOptions
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ApiConfiguration } from "../shared/api"
|
import { ApiConfiguration } from "../shared/api"
|
||||||
import { buildApiHandler } from "../api"
|
import { buildApiHandler } from "../api"
|
||||||
import { OpenRouterHandler, SingleCompletionHandler } from "../api/providers/openrouter"
|
import { OpenRouterHandler } from "../api/providers/openrouter"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enhances a prompt using the OpenRouter API without creating a full Cline instance or task history.
|
* Enhances a prompt using the OpenRouter API without creating a full Cline instance or task history.
|
||||||
|
|||||||
Reference in New Issue
Block a user