generated from ubiquity-os/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use open router and remove recalc of token
- Loading branch information
Showing
17 changed files
with
106 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { Context } from "../types"; | ||
import { AnthropicCompletion } from "./claude/helpers/completions"; | ||
import Anthropic from "@anthropic-ai/sdk"; | ||
import { SuperAnthropic } from "./claude/helpers/claude"; | ||
import { OpenRouterCompletion } from "./open-router/helpers/completions"; | ||
import { SuperOpenRouter } from "./open-router/helpers/open-router"; | ||
import OpenAI from "openai"; | ||
|
||
export function createAdapters(anthropic: Anthropic, context: Context) { | ||
export function createAdapters(openRouter: OpenAI, context: Context) { | ||
return { | ||
anthropic: { | ||
completions: new AnthropicCompletion(anthropic, context), | ||
super: new SuperAnthropic(anthropic, context), | ||
openRouter: { | ||
completions: new OpenRouterCompletion(openRouter, context), | ||
super: new SuperOpenRouter(openRouter, context), | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Context } from "../../../types/context"; | ||
import OpenAI from "openai"; | ||
|
||
export class SuperOpenRouter { | ||
protected client: OpenAI; | ||
protected context: Context; | ||
|
||
constructor(client: OpenAI, context: Context) { | ||
this.context = context; | ||
this.client = client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.