Fix OpenRouter calls by mapping openai sdk messages to and from anthropic sdk messages

This commit is contained in:
Saoud Rizwan
2024-08-03 18:06:33 -04:00
parent fa1068d92d
commit d7ee0c0161
5 changed files with 210 additions and 64 deletions

View File

@@ -10,6 +10,15 @@ export interface ApiHandler {
messages: Anthropic.Messages.MessageParam[],
tools: Anthropic.Messages.Tool[]
): Promise<Anthropic.Messages.Message>
createUserReadableRequest(
userContent: Array<
| Anthropic.TextBlockParam
| Anthropic.ImageBlockParam
| Anthropic.ToolUseBlockParam
| Anthropic.ToolResultBlockParam
>
): any
}
export function buildApiHandler(configuration: ApiConfiguration): ApiHandler {