feat: Add OpenRouter component for multi-provider model access (#5271)

* feat: add OpenRouter component for multi-provider model access

- Add OpenRouter integration with provider-based model selection
- Support dynamic model fetching from OpenRouter API
- Implement temperature and max tokens controls
- Add site URL and app name for rankings
- Include model tooltips with context length and descriptions

* fix: restore SambaNova component in models __init__.py

* refactor: simplify OpenRouter build_model method

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Raphael Valdetaro 2024-12-19 16:29:45 -03:00 • committed by GitHub
commit 9a8f721515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 234 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,9 @@
import React, { forwardRef } from "react";
import SvgOpenRouter from "./OpenRouterIcon";
export const OpenRouterIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <SvgOpenRouter ref={ref} {...props} />;
});

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -282,6 +282,7 @@ import { NotionIcon } from "../icons/Notion";
import { NvidiaIcon } from "../icons/Nvidia";
import { OllamaIcon } from "../icons/Ollama";
import { OpenAiIcon } from "../icons/OpenAi";
import { OpenRouterIcon } from "../icons/OpenRouter";
import { OpenSearch } from "../icons/OpenSearch";
import { PineconeIcon } from "../icons/Pinecone";
import { PostgresIcon } from "../icons/Postgres";
@ -666,6 +667,7 @@ export const nodeIconsLucide: iconsType = {
ChatOpenAI: OpenAiIcon,
AzureChatOpenAI: OpenAiIcon,
OpenAI: OpenAiIcon,
OpenRouter: OpenRouterIcon,
OpenAIEmbeddings: OpenAiIcon,
Pinecone: PineconeIcon,
Qdrant: QDrantIcon,