mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 05:11:06 -05:00
Add support for OpenRouter and AWS Bedrock
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// type that represents json data that is sent from extension to webview, called ExtensionMessage and has 'type' enum which can be 'plusButtonTapped' or 'settingsButtonTapped' or 'hello'
|
||||
|
||||
import { ApiConfiguration } from "./api"
|
||||
|
||||
// webview will hold state
|
||||
export interface ExtensionMessage {
|
||||
type: "action" | "state"
|
||||
@@ -9,7 +11,7 @@ export interface ExtensionMessage {
|
||||
}
|
||||
|
||||
export interface ExtensionState {
|
||||
apiKey?: string
|
||||
apiConfiguration?: ApiConfiguration
|
||||
maxRequestsPerTask?: number
|
||||
themeName?: string
|
||||
claudeMessages: ClaudeMessage[]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ApiConfiguration, ApiProvider } from "./api"
|
||||
|
||||
export interface WebviewMessage {
|
||||
type:
|
||||
| "apiKey"
|
||||
| "apiConfiguration"
|
||||
| "maxRequestsPerTask"
|
||||
| "webviewDidLaunch"
|
||||
| "newTask"
|
||||
@@ -10,6 +12,7 @@ export interface WebviewMessage {
|
||||
| "downloadTask"
|
||||
text?: string
|
||||
askResponse?: ClaudeAskResponse
|
||||
apiConfiguration?: ApiConfiguration
|
||||
}
|
||||
|
||||
export type ClaudeAskResponse = "yesButtonTapped" | "noButtonTapped" | "textResponse"
|
||||
|
||||
13
src/shared/api.ts
Normal file
13
src/shared/api.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export type ApiProvider = "anthropic" | "openrouter" | "bedrock"
|
||||
|
||||
export interface ApiHandlerOptions {
|
||||
apiKey?: string // anthropic
|
||||
openRouterApiKey?: string
|
||||
awsAccessKey?: string
|
||||
awsSecretKey?: string
|
||||
awsRegion?: string
|
||||
}
|
||||
|
||||
export type ApiConfiguration = ApiHandlerOptions & {
|
||||
apiProvider?: ApiProvider
|
||||
}
|
||||
Reference in New Issue
Block a user