feat: add ai/ml model and embedding components (#2781)

This commit is contained in:
Jordan Frazier 2024-07-18 11:52:38 -07:00 committed by GitHub
commit 5ed8d1a63a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 781 additions and 7 deletions

View file

@ -0,0 +1,77 @@
CHAT_MODELS = [
"zero-one-ai/Yi-34B-Chat",
"allenai/OLMo-7B-Instruct",
"allenai/OLMo-7B-Twin-2T",
"allenai/OLMo-7B",
"Austism/chronos-hermes-13b",
"cognitivecomputations/dolphin-2.5-mixtral-8x7b",
"deepseek-ai/deepseek-coder-33b-instruct",
"deepseek-ai/deepseek-llm-67b-chat",
"garage-bAInd/Platypus2-70B-instruct",
"google/gemma-2b-it",
"google/gemma-7b-it",
"Gryphe/MythoMax-L2-13b",
"lmsys/vicuna-13b-v1.5",
"lmsys/vicuna-7b-v1.5",
"codellama/CodeLlama-13b-Instruct-hf",
"codellama/CodeLlama-34b-Instruct-hf",
"codellama/CodeLlama-70b-Instruct-hf",
"codellama/CodeLlama-7b-Instruct-hf",
"meta-llama/Llama-2-70b-chat-hf",
"meta-llama/Llama-2-13b-chat-hf",
"meta-llama/Llama-2-7b-chat-hf",
"mistralai/Mistral-7B-Instruct-v0.1",
"mistralai/Mistral-7B-Instruct-v0.2",
"mistralai/Mixtral-8x7B-Instruct-v0.1",
"NousResearch/Nous-Capybara-7B-V1p9",
"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
"NousResearch/Nous-Hermes-2-Mixtral-8x7B-SFT",
"NousResearch/Nous-Hermes-llama-2-7b",
"NousResearch/Nous-Hermes-Llama2-13b",
"NousResearch/Nous-Hermes-2-Yi-34B",
"openchat/openchat-3.5-1210",
"Open-Orca/Mistral-7B-OpenOrca",
"togethercomputer/Qwen-7B-Chat",
"Qwen/Qwen1.5-0.5B-Chat",
"Qwen/Qwen1.5-1.8B-Chat",
"Qwen/Qwen1.5-4B-Chat",
"Qwen/Qwen1.5-7B-Chat",
"Qwen/Qwen1.5-14B-Chat",
"Qwen/Qwen1.5-72B-Chat",
"snorkelai/Snorkel-Mistral-PairRM-DPO",
"togethercomputer/alpaca-7b",
"teknium/OpenHermes-2-Mistral-7B",
"teknium/OpenHermes-2p5-Mistral-7B",
"togethercomputer/falcon-40b-instruct",
"togethercomputer/falcon-7b-instruct",
"togethercomputer/Llama-2-7B-32K-Instruct",
"togethercomputer/RedPajama-INCITE-Chat-3B-v1",
"togethercomputer/RedPajama-INCITE-7B-Chat",
"togethercomputer/StripedHyena-Nous-7B",
"Undi95/ReMM-SLERP-L2-13B",
"Undi95/Toppy-M-7B",
"WizardLM/WizardLM-13B-V1.2",
"upstage/SOLAR-10.7B-Instruct-v1.0",
"gpt-4",
"gpt-4-turbo",
"gpt-4-0613",
"gpt-4-32k",
"gpt-4-32k-0613",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-instruct",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-16k-0613",
"gpt-4o",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
]
EMBEDDING_MODELS = [
"text-embedding-3-small",
"text-embedding-3-large",
"text-embedding-ada-002",
]

View file

@ -0,0 +1,34 @@
from langflow.base.embeddings.model import LCEmbeddingsModel
from langflow.base.models.aiml_constants import EMBEDDING_MODELS
from langflow.components.embeddings.util.AIMLEmbeddingsImpl import AIMLEmbeddingsImpl
from langflow.field_typing import Embeddings
from langflow.inputs.inputs import DropdownInput
from langflow.io import SecretStrInput
class AIMLEmbeddingsComponent(LCEmbeddingsModel):
display_name = "AI/ML Embeddings"
description = "Generate embeddings using the AI/ML API."
icon = "AI/ML"
name = "AIMLEmbeddings"
inputs = [
DropdownInput(
name="model_name",
display_name="Model Name",
options=EMBEDDING_MODELS,
required=True,
),
SecretStrInput(
name="aiml_api_key",
display_name="AI/ML API Key",
value="AIML_API_KEY",
required=True,
),
]
def build_embeddings(self) -> Embeddings:
return AIMLEmbeddingsImpl(
api_key=self.aiml_api_key,
model=self.model_name,
)

View file

@ -1,3 +1,4 @@
from .AIMLEmbeddings import AIMLEmbeddingsComponent
from .AmazonBedrockEmbeddings import AmazonBedrockEmbeddingsComponent
from .AstraVectorize import AstraVectorizeComponent
from .AzureOpenAIEmbeddings import AzureOpenAIEmbeddingsComponent
@ -9,6 +10,7 @@ from .OpenAIEmbeddings import OpenAIEmbeddingsComponent
from .VertexAIEmbeddings import VertexAIEmbeddingsComponent
__all__ = [
"AIMLEmbeddingsComponent",
"AmazonBedrockEmbeddingsComponent",
"AstraVectorizeComponent",
"AzureOpenAIEmbeddingsComponent",

View file

@ -0,0 +1,70 @@
import json
from typing import List
import httpx
from langflow.field_typing import Embeddings
from langchain_core.runnables.config import run_in_executor
from langchain_core.pydantic_v1 import BaseModel, SecretStr
from loguru import logger
class AIMLEmbeddingsImpl(BaseModel, Embeddings):
embeddings_completion_url: str = "https://api.aimlapi.com/v1/embeddings"
api_key: SecretStr
model: str
def embed_documents(self, texts: List[str]) -> List[List[float]]:
result_vectors = []
for text in texts:
vector = self.embed_query(text)
result_vectors.append(vector)
return result_vectors
def embed_query(self, text: str) -> List[float]:
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {self.api_key.get_secret_value()}",
}
payload = {
"model": self.model,
"input": text,
}
vector = []
try:
response = httpx.post(
self.embeddings_completion_url,
headers=headers,
json=payload,
)
try:
response.raise_for_status()
result_data = response.json()
vector = result_data["data"][0]["embedding"]
except httpx.HTTPStatusError as http_err:
logger.error(f"HTTP error occurred: {http_err}")
raise http_err
except httpx.RequestError as req_err:
logger.error(f"Request error occurred: {req_err}")
raise req_err
except json.JSONDecodeError:
logger.warning(f"Failed to decode JSON, response text: {response.text}")
except KeyError as key_err:
logger.warning(f"Key error: {key_err}, response content: {result_data}")
raise key_err
except httpx.TimeoutException:
logger.error("Request timed out.")
raise
except Exception as exc:
logger.error(f"Error: {exc}")
raise
return vector
async def aembed_documents(self, texts: List[str]) -> List[List[float]]:
return await run_in_executor(None, self.embed_documents, texts)
async def aembed_query(self, text: str) -> List[float]:
return await run_in_executor(None, self.embed_query, text)

View file

@ -0,0 +1,148 @@
import json
import httpx
from langflow.base.models.aiml_constants import CHAT_MODELS
from langflow.custom.custom_component.component import Component
from langflow.inputs.inputs import FloatInput, IntInput, MessageInput, SecretStrInput
from langflow.schema.message import Message
from langflow.template.field.base import Output
from loguru import logger
from pydantic.v1 import SecretStr
from langflow.inputs import (
DropdownInput,
StrInput,
)
class AIMLModelComponent(Component):
display_name = "AI/ML API"
description = "Generates text using the AI/ML API"
icon = "AI/ML"
chat_completion_url = "https://api.aimlapi.com/v1/chat/completions"
outputs = [
Output(display_name="Text", name="text_output", method="make_request"),
]
inputs = [
DropdownInput(
name="model_name",
display_name="Model Name",
options=CHAT_MODELS,
required=True,
),
SecretStrInput(
name="aiml_api_key",
display_name="AI/ML API Key",
value="AIML_API_KEY",
),
MessageInput(name="input_value", display_name="Input", required=True),
IntInput(
name="max_tokens",
display_name="Max Tokens",
advanced=True,
info="The maximum number of tokens to generate. Set to 0 for unlimited tokens.",
),
StrInput(
name="stop_tokens",
display_name="Stop Tokens",
info="Comma-separated list of tokens to signal the model to stop generating text.",
advanced=True,
),
IntInput(
name="top_k",
display_name="Top K",
info="Limits token selection to top K. (Default: 40)",
advanced=True,
),
FloatInput(
name="top_p",
display_name="Top P",
info="Works together with top-k. (Default: 0.9)",
advanced=True,
),
FloatInput(
name="repeat_penalty",
display_name="Repeat Penalty",
info="Penalty for repetitions in generated text. (Default: 1.1)",
advanced=True,
),
FloatInput(
name="temperature",
display_name="Temperature",
value=0.2,
info="Controls the creativity of model responses.",
),
StrInput(
name="system_message",
display_name="System Message",
info="System message to pass to the model.",
advanced=True,
),
]
def make_request(self) -> Message:
api_key = SecretStr(self.aiml_api_key) if self.aiml_api_key else None
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key.get_secret_value()}" if api_key else "",
}
messages = []
if self.system_message:
messages.append({"role": "system", "content": self.system_message})
if self.input_value:
if isinstance(self.input_value, Message):
# Though we aren't using langchain here, the helper method is useful
message = self.input_value.to_lc_message()
if message.type == "human":
messages.append({"role": "user", "content": message.content})
else:
raise ValueError(f"Expected user message, saw: {message.type}")
else:
raise TypeError(f"Expected Message type, saw: {type(self.input_value)}")
else:
raise ValueError("Please provide an input value")
payload = {
"model": self.model_name,
"messages": messages,
"max_tokens": self.max_tokens or None,
"temperature": self.temperature or 0.2,
"top_k": self.top_k or 40,
"top_p": self.top_p or 0.9,
"repeat_penalty": self.repeat_penalty or 1.1,
"stop_tokens": self.stop_tokens or None,
}
try:
response = httpx.post(self.chat_completion_url, headers=headers, json=payload)
try:
response.raise_for_status()
result_data = response.json()
choice = result_data["choices"][0]
result = choice["message"]["content"]
except httpx.HTTPStatusError as http_err:
logger.error(f"HTTP error occurred: {http_err}")
raise http_err
except httpx.RequestError as req_err:
logger.error(f"Request error occurred: {req_err}")
raise req_err
except json.JSONDecodeError:
logger.warning("Failed to decode JSON, response text: {response.text}")
result = response.text
except KeyError as key_err:
logger.warning(f"Key error: {key_err}, response content: {result_data}")
raise key_err
self.status = result
except httpx.TimeoutException:
return Message(text="Request timed out.")
except Exception as exc:
logger.error(f"Error: {exc}")
raise
return Message(text=result)

View file

@ -45,7 +45,7 @@ class MistralAIModelComponent(LCModelComponent):
),
),
SecretStrInput(
name="mistral_api_key",
name="api_key",
display_name="Mistral API Key",
info="The Mistral API Key to use for the Mistral model.",
advanced=False,
@ -67,7 +67,7 @@ class MistralAIModelComponent(LCModelComponent):
]
def build_model(self) -> LanguageModel: # type: ignore[type-var]
mistral_api_key = self.mistral_api_key
mistral_api_key = self.api_key
temperature = self.temperature
model_name = self.model_name
max_tokens = self.max_tokens

View file

@ -76,7 +76,7 @@ class ChatOllamaComponent(LCModelComponent):
value="http://localhost:11434",
),
DropdownInput(
name="model",
name="model_name",
display_name="Model Name",
value="llama2",
info="Refer to https://ollama.ai/library for more models.",
@ -107,6 +107,7 @@ class ChatOllamaComponent(LCModelComponent):
info="Enable/disable Mirostat sampling for controlling perplexity.",
value="Disabled",
advanced=True,
real_time_refresh=True,
),
FloatInput(
name="mirostat_eta",
@ -238,7 +239,7 @@ class ChatOllamaComponent(LCModelComponent):
# Mapping system settings to their corresponding values
llm_params = {
"base_url": self.base_url,
"model": self.model,
"model": self.model_name,
"mirostat": mirostat_value,
"format": self.format,
"metadata": self.metadata,

View file

@ -58,7 +58,7 @@ class OpenAIModelComponent(LCModelComponent):
info="The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem.",
),
SecretStrInput(
name="openai_api_key",
name="api_key",
display_name="OpenAI API Key",
info="The OpenAI API Key to use for the OpenAI model.",
advanced=False,
@ -82,10 +82,10 @@ class OpenAIModelComponent(LCModelComponent):
]
def build_model(self) -> LanguageModel: # type: ignore[type-var]
# self.output_schea is a list of dictionarie s
# self.output_schema is a list of dictionaries
# let's convert it to a dictionary
output_schema_dict: dict[str, str] = reduce(operator.ior, self.output_schema or {}, {})
openai_api_key = self.openai_api_key
openai_api_key = self.api_key
temperature = self.temperature
model_name: str = self.model_name
max_tokens = self.max_tokens

View file

@ -1,3 +1,4 @@
from .AIMLModel import AIMLModelComponent
from .AmazonBedrockModel import AmazonBedrockComponent
from .AnthropicModel import AnthropicModelComponent
from .AzureOpenAIModel import AzureChatOpenAIComponent
@ -10,6 +11,7 @@ from .OpenAIModel import OpenAIModelComponent
from .VertexAiModel import ChatVertexAIComponent
__all__ = [
"AIMLModelComponent",
"AmazonBedrockComponent",
"AnthropicModelComponent",
"AzureChatOpenAIComponent",

View file

@ -0,0 +1,97 @@
<svg width="225" height="225" viewBox="0 0 225 225" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_13070_4340" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="12" width="225" height="201">
<path d="M221.23 100.528C225.475 107.88 225.475 116.937 221.23 124.289L177.213 200.528C172.969 207.88 165.125 212.408 156.636 212.408H68.6026C60.1138 212.408 52.2698 207.88 48.0254 200.528L4.00849 124.289C-0.235924 116.937 -0.235893 107.88 4.00852 100.528L48.0254 24.2887C52.2698 16.9372 60.1138 12.4084 68.6026 12.4084L156.636 12.4085C165.125 12.4085 172.969 16.9372 177.213 24.2887L221.23 100.528Z" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask0_13070_4340)">
<g filter="url(#filter0_f_13070_4340)">
<path d="M165.65 134.568C255.877 91.3794 93.882 -221.746 120.117 -119.206C137.15 -52.6304 77.7037 -62.5848 83.7299 -25.8396C87.9511 -0.101322 88.9044 19.4797 85.795 34.529C82.048 52.6636 80.9887 83.384 89.784 99.6795C104.975 127.824 115.931 158.366 165.65 134.568Z" fill="#D6FFF4"/>
</g>
<g filter="url(#filter1_f_13070_4340)">
<path d="M-42.7886 -29.6695C-26.1866 -27.9249 -3.61291 -21.6434 28.8941 -7.51849C106.528 26.215 114.949 160.877 67.7629 202.317C22.3388 242.209 -288.768 175.806 -249.16 172.629C-56.6506 157.189 5.60256 124.472 -60.9868 48.8517C-77.0297 30.6332 -66.9309 -32.2064 -42.7886 -29.6695Z" fill="#84DBFF"/>
</g>
<g filter="url(#filter2_f_13070_4340)">
<path d="M211.54 319.622C294.158 280.076 145.824 -6.64398 169.846 87.2493C185.443 148.21 131.01 139.095 136.528 172.742C140.074 194.365 141.101 211.242 139.048 224.523C136.218 242.823 135.097 274.442 143.746 290.816C156.852 315.632 167.858 340.531 211.54 319.622Z" fill="#FFBDF7"/>
</g>
<g filter="url(#filter3_f_13070_4340)">
<path d="M235.875 39.3835C200.055 -8.7256 51.8499 113.382 104.046 88.866C137.935 72.949 140.641 108.159 159.807 101.321C164.007 99.8228 167.922 98.5641 171.584 97.5545C190.109 92.4472 233.488 87.3544 242.919 70.612C247.043 63.29 246.735 53.9698 235.875 39.3835Z" fill="#FF4CE9"/>
</g>
<g filter="url(#filter4_f_13070_4340)">
<path d="M202.147 159.126C168.49 102.066 -113.331 257.654 -22.2837 225.406C36.8296 204.469 25.3558 247.288 57.8261 238.086C79.9207 231.825 96.7819 228.505 109.681 228.432C125.904 228.34 150.315 227.197 164.296 218.969C190.597 203.492 221.619 192.136 202.147 159.126Z" fill="#1C38FF"/>
</g>
<path d="M-16.6948 6.97169C-16.6948 -6.15092 -6.05688 -16.7888 7.06569 -16.7888H204.33C217.452 -16.7888 228.09 -6.15092 228.09 6.9717V215.178C228.09 228.301 217.452 238.939 204.33 238.939H7.0657C-6.05688 238.939 -16.6948 228.301 -16.6948 215.178V6.97169Z" fill="white"/>
</g>
<mask id="mask1_13070_4340" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="12" width="225" height="201">
<path d="M221.23 100.528C225.475 107.88 225.475 116.937 221.23 124.289L177.213 200.528C172.969 207.88 165.125 212.408 156.636 212.408H68.6026C60.1138 212.408 52.2698 207.88 48.0254 200.528L4.00849 124.289C-0.235924 116.937 -0.235893 107.88 4.00852 100.528L48.0254 24.2887C52.2698 16.9372 60.1138 12.4084 68.6026 12.4084L156.636 12.4085C165.125 12.4085 172.969 16.9372 177.213 24.2887L221.23 100.528Z" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask1_13070_4340)">
<g filter="url(#filter5_f_13070_4340)">
<path d="M165.65 134.568C255.877 91.3794 93.8815 -221.746 120.116 -119.206C137.15 -52.6303 77.7031 -62.5847 83.7294 -25.8395C92.2696 26.2346 87.4336 53.1043 62.6367 68.2335C102.986 89.1354 93.4683 169.118 165.65 134.568Z" fill="#D6FFF4"/>
</g>
<g filter="url(#filter6_f_13070_4340)">
<path d="M-126.644 -9.89283C-75.224 -3.16423 -93.0002 -60.4838 28.8942 -7.51843C106.528 26.215 114.949 160.877 67.7629 202.317C22.3388 242.209 -288.768 175.806 -249.16 172.629C-12.7415 153.667 27.2247 108.648 -126.644 -9.89283Z" fill="#3CC6FF"/>
</g>
<g filter="url(#filter7_f_13070_4340)">
<path d="M211.541 319.622C294.159 280.076 145.825 -6.64398 169.848 87.2493C185.445 148.21 131.011 139.095 136.529 172.742C144.349 220.425 139.921 245.028 117.215 258.882C154.162 278.021 145.447 351.259 211.541 319.622Z" fill="#FFBDF7"/>
</g>
<g filter="url(#filter8_f_13070_4340)">
<path d="M235.875 39.3835C200.055 -8.7256 51.8498 113.382 104.046 88.8661C137.935 72.9491 140.641 108.159 159.807 101.321C186.968 91.6309 202.245 91.9637 213.862 104.887C219.721 79.6947 264.53 77.8708 235.875 39.3835Z" fill="#F900DA"/>
</g>
<g filter="url(#filter9_f_13070_4340)">
<path d="M202.147 159.126C168.49 102.066 -113.331 257.654 -22.2837 225.406C36.8295 204.469 25.3557 247.288 57.8261 238.086C103.842 225.046 127.157 224.764 139.263 240.002C159.443 209.014 229.073 204.773 202.147 159.126Z" fill="#1C38FF"/>
</g>
<path d="M229.228 -54.4146H-72.6978V254.311H229.228V-54.4146Z" fill="#090F1D"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M64.3116 145.981C62.6561 145.981 60.9903 145.454 59.5831 144.377C56.1893 141.76 55.5478 136.886 58.1656 133.493L89.1338 93.2431C90.3961 91.598 92.2689 90.5322 94.3176 90.2736C96.4077 90.0045 98.4564 90.584 100.081 91.8773L129.259 114.796L154.785 81.8615C157.413 78.4574 162.276 77.8263 165.67 80.4751C169.064 83.1032 169.684 87.9766 167.056 91.36L136.74 130.471C135.478 132.106 133.615 133.172 131.566 133.42C129.497 133.699 127.448 133.099 125.814 131.827L96.656 108.919L70.468 142.95C68.9367 144.936 66.6397 145.981 64.3116 145.981Z" fill="white"/>
<defs>
<filter id="filter0_f_13070_4340" x="-9.69949" y="-232.433" width="295.688" height="468.268" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="46.36" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter1_f_13070_4340" x="-393.791" y="-170.9" width="631.774" height="527.092" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="70.5779" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter2_f_13070_4340" x="51.233" y="-16.4296" width="270.498" height="428.779" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="42.4504" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter3_f_13070_4340" x="8.12459" y="-56.8542" width="322.143" height="243.969" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="42.4504" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter4_f_13070_4340" x="-125.207" y="61.5247" width="418.363" height="262.778" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="42.4504" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter5_f_13070_4340" x="-30.0833" y="-232.433" width="316.072" height="468.268" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="46.36" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter6_f_13070_4340" x="-393.791" y="-171.355" width="631.774" height="527.546" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="70.5779" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter7_f_13070_4340" x="32.3145" y="-16.4296" width="289.417" height="428.779" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="42.4504" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter8_f_13070_4340" x="8.12459" y="-56.8542" width="322.142" height="246.642" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="42.4504" result="effect1_foregroundBlur_13070_4340"/>
</filter>
<filter id="filter9_f_13070_4340" x="-125.207" y="61.5247" width="418.363" height="263.378" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="42.4504" result="effect1_foregroundBlur_13070_4340"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 9 KiB

View file

@ -0,0 +1,332 @@
import { cn } from "@/utils/utils";
export const AIMLComponent = ({ className, ...props }) => (
<svg
className={cn("dark:invert", className)}
width="225"
height="225"
viewBox="0 0 225 225"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<mask
id="mask0_13070_4340"
style={{ maskType: "alpha" }}
maskUnits="userSpaceOnUse"
x="0"
y="12"
width="225"
height="201"
>
<path
d="M221.23 100.528C225.475 107.88 225.475 116.937 221.23 124.289L177.213 200.528C172.969 207.88 165.125 212.408 156.636 212.408H68.6026C60.1138 212.408 52.2698 207.88 48.0254 200.528L4.00849 124.289C-0.235924 116.937 -0.235893 107.88 4.00852 100.528L48.0254 24.2887C52.2698 16.9372 60.1138 12.4084 68.6026 12.4084L156.636 12.4085C165.125 12.4085 172.969 16.9372 177.213 24.2887L221.23 100.528Z"
fill="#D9D9D9"
/>
</mask>
<g mask="url(#mask0_13070_4340)">
<g filter="url(#filter0_f_13070_4340)">
<path
d="M165.65 134.568C255.877 91.3794 93.882 -221.746 120.117 -119.206C137.15 -52.6304 77.7037 -62.5848 83.7299 -25.8396C87.9511 -0.101322 88.9044 19.4797 85.795 34.529C82.048 52.6636 80.9887 83.384 89.784 99.6795C104.975 127.824 115.931 158.366 165.65 134.568Z"
fill="#D6FFF4"
/>
</g>
<g filter="url(#filter1_f_13070_4340)">
<path
d="M-42.7886 -29.6695C-26.1866 -27.9249 -3.61291 -21.6434 28.8941 -7.51849C106.528 26.215 114.949 160.877 67.7629 202.317C22.3388 242.209 -288.768 175.806 -249.16 172.629C-56.6506 157.189 5.60256 124.472 -60.9868 48.8517C-77.0297 30.6332 -66.9309 -32.2064 -42.7886 -29.6695Z"
fill="#84DBFF"
/>
</g>
<g filter="url(#filter2_f_13070_4340)">
<path
d="M211.54 319.622C294.158 280.076 145.824 -6.64398 169.846 87.2493C185.443 148.21 131.01 139.095 136.528 172.742C140.074 194.365 141.101 211.242 139.048 224.523C136.218 242.823 135.097 274.442 143.746 290.816C156.852 315.632 167.858 340.531 211.54 319.622Z"
fill="#FFBDF7"
/>
</g>
<g filter="url(#filter3_f_13070_4340)">
<path
d="M235.875 39.3835C200.055 -8.7256 51.8499 113.382 104.046 88.866C137.935 72.949 140.641 108.159 159.807 101.321C164.007 99.8228 167.922 98.5641 171.584 97.5545C190.109 92.4472 233.488 87.3544 242.919 70.612C247.043 63.29 246.735 53.9698 235.875 39.3835Z"
fill="#FF4CE9"
/>
</g>
<g filter="url(#filter4_f_13070_4340)">
<path
d="M202.147 159.126C168.49 102.066 -113.331 257.654 -22.2837 225.406C36.8296 204.469 25.3558 247.288 57.8261 238.086C79.9207 231.825 96.7819 228.505 109.681 228.432C125.904 228.34 150.315 227.197 164.296 218.969C190.597 203.492 221.619 192.136 202.147 159.126Z"
fill="#1C38FF"
/>
</g>
<path
d="M-16.6948 6.97169C-16.6948 -6.15092 -6.05688 -16.7888 7.06569 -16.7888H204.33C217.452 -16.7888 228.09 -6.15092 228.09 6.9717V215.178C228.09 228.301 217.452 238.939 204.33 238.939H7.0657C-6.05688 238.939 -16.6948 228.301 -16.6948 215.178V6.97169Z"
fill="white"
/>
</g>
<mask
id="mask1_13070_4340"
style={{ maskType: "alpha" }}
maskUnits="userSpaceOnUse"
x="0"
y="12"
width="225"
height="201"
>
<path
d="M221.23 100.528C225.475 107.88 225.475 116.937 221.23 124.289L177.213 200.528C172.969 207.88 165.125 212.408 156.636 212.408H68.6026C60.1138 212.408 52.2698 207.88 48.0254 200.528L4.00849 124.289C-0.235924 116.937 -0.235893 107.88 4.00852 100.528L48.0254 24.2887C52.2698 16.9372 60.1138 12.4084 68.6026 12.4084L156.636 12.4085C165.125 12.4085 172.969 16.9372 177.213 24.2887L221.23 100.528Z"
fill="#D9D9D9"
/>
</mask>
<g mask="url(#mask1_13070_4340)">
<g filter="url(#filter5_f_13070_4340)">
<path
d="M165.65 134.568C255.877 91.3794 93.8815 -221.746 120.116 -119.206C137.15 -52.6303 77.7031 -62.5847 83.7294 -25.8395C92.2696 26.2346 87.4336 53.1043 62.6367 68.2335C102.986 89.1354 93.4683 169.118 165.65 134.568Z"
fill="#D6FFF4"
/>
</g>
<g filter="url(#filter6_f_13070_4340)">
<path
d="M-126.644 -9.89283C-75.224 -3.16423 -93.0002 -60.4838 28.8942 -7.51843C106.528 26.215 114.949 160.877 67.7629 202.317C22.3388 242.209 -288.768 175.806 -249.16 172.629C-12.7415 153.667 27.2247 108.648 -126.644 -9.89283Z"
fill="#3CC6FF"
/>
</g>
<g filter="url(#filter7_f_13070_4340)">
<path
d="M211.541 319.622C294.159 280.076 145.825 -6.64398 169.848 87.2493C185.445 148.21 131.011 139.095 136.529 172.742C144.349 220.425 139.921 245.028 117.215 258.882C154.162 278.021 145.447 351.259 211.541 319.622Z"
fill="#FFBDF7"
/>
</g>
<g filter="url(#filter8_f_13070_4340)">
<path
d="M235.875 39.3835C200.055 -8.7256 51.8498 113.382 104.046 88.8661C137.935 72.9491 140.641 108.159 159.807 101.321C186.968 91.6309 202.245 91.9637 213.862 104.887C219.721 79.6947 264.53 77.8708 235.875 39.3835Z"
fill="#F900DA"
/>
</g>
<g filter="url(#filter9_f_13070_4340)">
<path
d="M202.147 159.126C168.49 102.066 -113.331 257.654 -22.2837 225.406C36.8295 204.469 25.3557 247.288 57.8261 238.086C103.842 225.046 127.157 224.764 139.263 240.002C159.443 209.014 229.073 204.773 202.147 159.126Z"
fill="#1C38FF"
/>
</g>
<path
d="M229.228 -54.4146H-72.6978V254.311H229.228V-54.4146Z"
fill="#090F1D"
/>
</g>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M64.3116 145.981C62.6561 145.981 60.9903 145.454 59.5831 144.377C56.1893 141.76 55.5478 136.886 58.1656 133.493L89.1338 93.2431C90.3961 91.598 92.2689 90.5322 94.3176 90.2736C96.4077 90.0045 98.4564 90.584 100.081 91.8773L129.259 114.796L154.785 81.8615C157.413 78.4574 162.276 77.8263 165.67 80.4751C169.064 83.1032 169.684 87.9766 167.056 91.36L136.74 130.471C135.478 132.106 133.615 133.172 131.566 133.42C129.497 133.699 127.448 133.099 125.814 131.827L96.656 108.919L70.468 142.95C68.9367 144.936 66.6397 145.981 64.3116 145.981Z"
fill="white"
/>
<defs>
<filter
id="filter0_f_13070_4340"
x="-9.69949"
y="-232.433"
width="295.688"
height="468.268"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="46.36"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter1_f_13070_4340"
x="-393.791"
y="-170.9"
width="631.774"
height="527.092"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="70.5779"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter2_f_13070_4340"
x="51.233"
y="-16.4296"
width="270.498"
height="428.779"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="42.4504"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter3_f_13070_4340"
x="8.12459"
y="-56.8542"
width="322.143"
height="243.969"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="42.4504"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter4_f_13070_4340"
x="-125.207"
y="61.5247"
width="418.363"
height="262.778"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="42.4504"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter5_f_13070_4340"
x="-30.0833"
y="-232.433"
width="316.072"
height="468.268"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="46.36"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter6_f_13070_4340"
x="-393.791"
y="-171.355"
width="631.774"
height="527.546"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="70.5779"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter7_f_13070_4340"
x="32.3145"
y="-16.4296"
width="289.417"
height="428.779"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="42.4504"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter8_f_13070_4340"
x="8.12459"
y="-56.8542"
width="322.142"
height="246.642"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="42.4504"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
<filter
id="filter9_f_13070_4340"
x="-125.207"
y="61.5247"
width="418.363"
height="263.378"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="BackgroundImageFix"
result="shape"
/>
<feGaussianBlur
stdDeviation="42.4504"
result="effect1_foregroundBlur_13070_4340"
/>
</filter>
</defs>
</svg>
);

View file

@ -0,0 +1,8 @@
import React, { forwardRef } from "react";
import { AIMLComponent } from "./AI-ML";
export const AIMLIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => {
return <AIMLComponent ref={ref} {...props} />;
},
);

View file

@ -1,3 +1,4 @@
import { AIMLIcon } from "@/icons/AIML";
import { freezeAllIcon } from "@/icons/freezeAll";
import {
AlertCircle,
@ -581,4 +582,6 @@ export const nodeIconsLucide: iconsType = {
PGVector: CpuIcon,
Confluence: ConfluenceIcon,
FreezeAll: freezeAllIcon,
AIML: AIMLIcon,
"AI/ML": AIMLIcon,
};