|
import chainlit as cl |
|
from gradio_client import Client |
|
from openai import OpenAI |
|
from groq import Groq |
|
import requests |
|
from chainlit.input_widget import Select, Slider |
|
import os |
|
import cohere |
|
from huggingface_hub import InferenceClient |
|
from fireworks.client import Fireworks |
|
|
|
|
|
hf_token = os.environ.get("HF_TOKEN") |
|
hf_token_llama_3_1 = os.environ.get('HF_TOKEN_FOR_31') |
|
openai_api_key = os.environ.get('OPENAI_API_KEY') |
|
groq_api_key = os.environ.get('GROQ_API_KEY') |
|
cohere_api_key = os.environ.get('COHERE_API_KEY') |
|
fireworks_api_key = os.environ.get('FIREWORKS_API_KEY') |
|
hf_text_client = Client("Artin2009/text-generation", hf_token=hf_token) |
|
|
|
openai_client = OpenAI(api_key=openai_api_key) |
|
groq_client = Groq(api_key=groq_api_key) |
|
|
|
co = cohere.Client( |
|
api_key=cohere_api_key, |
|
) |
|
nvidia_api_key = os.environ.get('NVIDIA_API_KEY') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cl.set_starters |
|
async def set_starters(): |
|
return [ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
] |
|
|
|
|
|
@cl.step(type="tool") |
|
async def tool(): |
|
|
|
await cl.sleep(0.5) |
|
|
|
return "Response from the tool!" |
|
|
|
@cl.set_chat_profiles |
|
async def chat_profile(): |
|
return [ |
|
cl.ChatProfile( |
|
name="default", |
|
markdown_description="default model", |
|
), |
|
cl.ChatProfile( |
|
name="neural-brain-AI", |
|
markdown_description="The main model of neural brain", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Dorna-AI", |
|
markdown_description="One of the open-sourced models that neural brain team fine-tuned", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
|
|
|
|
|
|
|
|
cl.ChatProfile( |
|
name="gpt4-o-mini", |
|
markdown_description="The best state of the art openai model", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="GPT-4", |
|
markdown_description="OpenAI's GPT-4 model", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="gpt-3.5-turbo", |
|
markdown_description="OpenAI's GPT-3.5 Turbo model", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
|
|
|
|
|
|
|
|
cl.ChatProfile( |
|
name="gpt-3.5-turbo-1106", |
|
markdown_description="OpenAI's GPT-3.5 Turbo 1106 model", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
|
|
|
|
|
|
|
|
cl.ChatProfile( |
|
name="TTS", |
|
markdown_description="OpenAI's Text-to-Speech model", |
|
), |
|
cl.ChatProfile( |
|
name="Qwen2-57B", |
|
markdown_description="Qwen second generation model with 57B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Qwen2-7B", |
|
markdown_description="Qwen second generation model with 7B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Qwen2-1.5B", |
|
markdown_description="Qwen second generation model with 1.5B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Qwen2-0.5B", |
|
markdown_description="Qwen second generation model with 0.5B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Qwen1.5-110B", |
|
markdown_description="Qwen first generation improved model with 110B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
|
|
|
|
|
|
|
|
cl.ChatProfile( |
|
name="Qwen1.5-32B", |
|
markdown_description="Qwen first generation improved model with 32B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Qwen1.5-2.7B", |
|
markdown_description="Qwen first generation improved model with 2.7B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cl.ChatProfile( |
|
name="Llama-3.1-405B", |
|
markdown_description="Meta Open Source Model Llama with 405B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Llama-3.1-70B", |
|
markdown_description="Meta Open Source Model Llama with 70B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Llama-3.1-8B", |
|
markdown_description="Meta Open Source Model Llama with 8B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Llama-3-70B", |
|
markdown_description="Meta Open Source model Llama-3 with 70B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="Llama-3-8B", |
|
markdown_description="Meta Open Source model Llama-2 with 7B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='Aya-35B', |
|
markdown_description='Cohere open sourced AI model with 35B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='Aya-23B', |
|
markdown_description='Cohere open sourced AI model with 23B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='Command-R-Plus', |
|
markdown_description='Cohere open sourced AI model named Command R plus', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='Command-R', |
|
markdown_description='Cohere open sourced AI model named Command R', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
|
|
), |
|
cl.ChatProfile( |
|
name='Command-Light', |
|
markdown_description='Cohere open sourced AI model named Command R', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
|
|
), |
|
cl.ChatProfile( |
|
name='Command-Light-Nightly', |
|
markdown_description='Cohere open sourced AI model named Command R', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
|
|
), |
|
cl.ChatProfile( |
|
name='Command-Nightly', |
|
markdown_description='Cohere open sourced AI model named Command R', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
|
|
), |
|
cl.ChatProfile( |
|
name='Command', |
|
markdown_description='Cohere open sourced AI model named Command R', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
|
|
), |
|
|
|
cl.ChatProfile( |
|
name = "gemma2-27B", |
|
markdown_description = 'Google Generation 2 Open Source LLM with 27B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
|
|
cl.ChatProfile( |
|
name = "gemma2-9B", |
|
markdown_description = 'Google Generation 2 Open Source LLM with 9B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name = "gemma-7B", |
|
markdown_description = 'Google Generation 1 Open Source LLM with 7B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name="zephyr-7B", |
|
markdown_description="Open Source model Zephyr with 7B parameters", |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='mistral-nemo-12B', |
|
markdown_description='mistral open source LLM with 12B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='mixtral-8x7B', |
|
markdown_description = 'mistral open source LLM with 7B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='mistral-7B-v2', |
|
markdown_description = 'mistral open source LLM with 7B parameters', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
cl.ChatProfile( |
|
name='Yi-1.5-34B', |
|
markdown_description = 'Yi-1.5 34B from 01-AI', |
|
starters=[ |
|
cl.Starter( |
|
label="Morning routine ideation", |
|
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/idea.svg", |
|
), |
|
|
|
cl.Starter( |
|
label="Explain superconductors", |
|
message="Explain superconductors like I'm five years old.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/learn.svg", |
|
), |
|
cl.Starter( |
|
label="Python script for daily email reports", |
|
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/terminal.svg", |
|
), |
|
cl.Starter( |
|
label="Text inviting friend to wedding", |
|
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.", |
|
icon="https://chainlit-rag-copilot-r2xd.onrender.com/public/write.svg", |
|
) |
|
|
|
] |
|
), |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cl.on_chat_start |
|
async def on_chat_start(): |
|
chat_profile = cl.user_session.get("chat_profile") |
|
if chat_profile == 'default': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="NB-Model", |
|
label="NeuralBrain - Models", |
|
values=["default-gpt4-o-mini"], |
|
initial_index=0, |
|
) |
|
] |
|
).send() |
|
|
|
if chat_profile == 'neural-brain-AI': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="NB-Model", |
|
label="NeuralBrain - Models", |
|
values=["Neural Brain AI"], |
|
initial_index=0, |
|
) |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Dorna-AI': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="param_3", |
|
label="Parameter 3", |
|
values=["512"], |
|
initial_index=0, |
|
tooltip="Config parameter 3 (e.g., max tokens)", |
|
), |
|
Select( |
|
id="param_4", |
|
label="Parameter 4", |
|
values=["0.7"], |
|
initial_index=0, |
|
tooltip="Config parameter 4 (e.g., temperature)", |
|
), |
|
Select( |
|
id="param_5", |
|
label="Parameter 5", |
|
values=["0.95"], |
|
initial_index=0, |
|
tooltip="Config parameter 5 (e.g., top_p)", |
|
), |
|
Select( |
|
id="api_name", |
|
label="API Name", |
|
values=["/chat"], |
|
initial_index=0, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'gpt4-o-mini': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="OpenAI-Model", |
|
label="OpenAI - Model", |
|
values=["gpt4-o-mini"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if chat_profile == 'GPT-4': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="OpenAI-Model", |
|
label="OpenAI - Model", |
|
values=["gpt-4"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'gpt-3.5-turbo': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="OpenAI-Model", |
|
label="OpenAI - Model", |
|
values=["gpt-3.5-turbo"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if chat_profile == 'gpt-3.5-turbo-1106': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="OpenAI-Model", |
|
label="OpenAI - Model", |
|
values=["gpt-3.5-turbo-1106"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if chat_profile == 'TTS': |
|
await cl.Message( |
|
content="Im TTS. of the best models OpenAI ever created. i can convert text to speech! . i was configured by Artin Daneshvar and Sadra Noadoust, 2 iranian students to help you, how can i assist you today ? " |
|
).send() |
|
|
|
if chat_profile == 'Qwen2-57B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Qwen-Model", |
|
label="Qwen - Model", |
|
values=["Qwen2-57B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Qwen2-7B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Qwen-Model", |
|
label="Qwen - Model", |
|
values=["Qwen2-7B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Qwen2-1.5B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Qwen-Model", |
|
label="Qwen - Model", |
|
values=["Qwen2-1.5B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Qwen2-0.5B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Qwen-Model", |
|
label="Qwen - Model", |
|
values=["Qwen2-0.5B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Qwen1.5-110B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Qwen-Model", |
|
label="Qwen - Model", |
|
values=["Qwen1.5-110B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if chat_profile == 'Qwen1.5-32B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Qwen-Model", |
|
label="Qwen - Model", |
|
values=["Qwen1.5-32B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Qwen1.5-2.7B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Qwen-Model", |
|
label="Qwen - Model", |
|
values=["Qwen1.5-2.7B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if chat_profile == 'Llama-3.1-405B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Meta-Model", |
|
label="Meta - Model", |
|
values=["Llama-3.1-405B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Llama-3.1-70B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Meta-Model", |
|
label="Meta - Model", |
|
values=["Llama-3.1-70B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Llama-3.1-8B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Meta-Model", |
|
label="Meta - Model", |
|
values=["Llama-3.1-8B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Llama-3-70B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Meta-Model", |
|
label="Meta - Model", |
|
values=["Llama-3-70B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
if chat_profile == 'Llama-3-8B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Meta-Model", |
|
label="Meta - Model", |
|
values=["Llama-3-8B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
|
|
if chat_profile == 'Aya-23B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Aya-23B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Aya-35B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Aya-35B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Command-R-Plus': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Command-R-Plus"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Command-Nightly': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Command-Nightly"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Command-Light-Nightly': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Command-Light-Nigtly"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Command-Light': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Command-Light"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Command-R': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Command-R"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'Command': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Cohere-Model", |
|
label="Cohere - Model", |
|
values=["Command"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'gemma2-27B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Google-Model", |
|
label="Google - Model", |
|
values=["Gemma2-27B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
if chat_profile == 'gemma2-9B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Google-Model", |
|
label="Google - Model", |
|
values=["Gemma2-9B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'gemma-7B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Google-Model", |
|
label="Google - Model", |
|
values=["Gemma-7B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
if chat_profile == 'zephyr-7B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="zephyr-Model", |
|
label="zephyr - Model", |
|
values=["zephyr-7B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
if chat_profile == 'mixtral-8x7B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Mistral-Model", |
|
label="Mistral - Model", |
|
values=["mixtral-8x7B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
if chat_profile == 'mistral-nemo-12B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Mistral-Model", |
|
label="Mistral - Model", |
|
values=["mistral-nemo-12B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
if chat_profile == 'mistral-7B-v2': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="Mistral-Model", |
|
label="Mistral - Model", |
|
values=["mistral-7B-v2"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
if chat_profile == 'Yi-1.5-34B': |
|
await cl.ChatSettings( |
|
[ |
|
Select( |
|
id="01AI-Model", |
|
label="01AI - Model", |
|
values=["Yi-1.5-34B"], |
|
initial_index=0, |
|
), |
|
Slider( |
|
id="Temperature", |
|
label="Model Temperature", |
|
initial=0.7, |
|
min=0, |
|
max=1, |
|
step=0.1, |
|
), |
|
] |
|
).send() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cl.on_message |
|
async def main(message: cl.Message): |
|
chat_profile = cl.user_session.get("chat_profile") |
|
msg = cl.Message(content="") |
|
await msg.send() |
|
|
|
if chat_profile == 'default': |
|
stream = completion = openai_client.chat.completions.create( |
|
model="gpt-4o-mini", |
|
messages=[ |
|
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"}, |
|
{"role": "user", "content": message.content} |
|
], |
|
stream=True |
|
) |
|
|
|
for part in stream: |
|
if token := part.choices[0].delta.content or "": |
|
await msg.stream_token(token) |
|
|
|
if chat_profile == 'neural-brain-AI': |
|
stream = completion = openai_client.chat.completions.create( |
|
model="ft:gpt-3.5-turbo-1106:nb:aria1:9UWDrLJK", |
|
messages=[ |
|
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"}, |
|
{"role": "user", "content": message.content} |
|
], |
|
stream=True |
|
) |
|
|
|
for part in stream: |
|
if token := part.choices[0].delta.content or "": |
|
await msg.stream_token(token) |
|
|
|
elif chat_profile == "Dorna-AI": |
|
stream_list = [] |
|
msg = cl.Message(content="") |
|
await msg.send() |
|
for res in hf_text_client.predict( |
|
message=message.content, |
|
system_message=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/chat" |
|
): |
|
stream_list.append(res) |
|
for token in stream_list: |
|
await msg.stream_token(token) |
|
elif chat_profile == "gpt4-o-mini": |
|
stream = completion = openai_client.chat.completions.create( |
|
model="gpt-4o-mini", |
|
messages=[ |
|
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"}, |
|
{"role": "user", "content": message.content} |
|
], |
|
stream=True |
|
) |
|
|
|
for part in stream: |
|
if token := part.choices[0].delta.content or "": |
|
await msg.stream_token(token) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif chat_profile == 'GPT-4': |
|
stream = completion = openai_client.chat.completions.create( |
|
model="gpt-4", |
|
messages=[ |
|
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"}, |
|
{"role": "user", "content": message.content} |
|
], |
|
stream=True |
|
) |
|
|
|
for part in stream: |
|
if token := part.choices[0].delta.content or "": |
|
await msg.stream_token(token) |
|
|
|
elif chat_profile == 'gpt-3.5-turbo': |
|
stream = completion = openai_client.chat.completions.create( |
|
model="gpt-3.5-turbo", |
|
messages=[ |
|
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"}, |
|
{"role": "user", "content": message.content} |
|
], |
|
stream=True |
|
) |
|
|
|
for part in stream: |
|
if token := part.choices[0].delta.content or "": |
|
await msg.stream_token(token) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif chat_profile == 'gpt-3.5-turbo-1106': |
|
stream = completion = openai_client.chat.completions.create( |
|
model="gpt-3.5-turbo-1106", |
|
messages=[ |
|
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"}, |
|
{"role": "user", "content": message.content} |
|
], |
|
stream=True |
|
) |
|
|
|
for part in stream: |
|
if token := part.choices[0].delta.content or "": |
|
await msg.stream_token(token) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif chat_profile == 'TTS': |
|
response = openai_client.audio.speech.create( |
|
model="tts-1", |
|
voice="alloy", |
|
input=message.content, |
|
) |
|
|
|
response.stream_to_file("output.mp3") |
|
|
|
elements = [ |
|
cl.Audio(name="output.mp3", path="./output.mp3", display="inline"), |
|
] |
|
await cl.Message( |
|
content="Here it is the response!", |
|
elements=elements, |
|
).send() |
|
|
|
elif chat_profile == 'Qwen2-57B': |
|
msg = cl.Message(content="") |
|
await msg.send() |
|
client = Client("Qwen/Qwen2-57b-a14b-instruct-demo", hf_token=hf_token) |
|
result = client.predict( |
|
query=message.content, |
|
system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/model_chat" |
|
) |
|
|
|
for i in list(result[1][0][1]): |
|
await msg.stream_token(i) |
|
|
|
|
|
|
|
|
|
|
|
elif chat_profile == 'Qwen2-7B': |
|
client = Client("Qwen/Qwen2-7b-instruct-demo", hf_token=hf_token) |
|
result = client.predict( |
|
query=message.content, |
|
system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/model_chat" |
|
) |
|
|
|
for i in list(result[1][0][1]): |
|
await msg.stream_token(i) |
|
|
|
|
|
elif chat_profile == 'Qwen2-1.5B': |
|
client = Client("Qwen/Qwen2-1.5b-instruct-demo", hf_token=hf_token) |
|
result = client.predict( |
|
query=message.content, |
|
system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/model_chat" |
|
) |
|
|
|
for i in list(result[1][0][1]): |
|
await msg.stream_token(i) |
|
|
|
|
|
elif chat_profile == 'Qwen2-0.5B': |
|
client = Client("Qwen/Qwen2-0.5B-Instruct", hf_token=hf_token) |
|
result = client.predict( |
|
query=message.content, |
|
system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/model_chat" |
|
) |
|
|
|
for i in list(result[1][0][1]): |
|
await msg.stream_token(i) |
|
|
|
elif chat_profile == 'Qwen1.5-110B': |
|
client = Client("Qwen/Qwen1.5-110B-Chat-demo", hf_token=hf_token) |
|
result = client.predict( |
|
query=message.content, |
|
system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/model_chat" |
|
) |
|
|
|
for i in list(result[1][0][1]): |
|
await msg.stream_token(i) |
|
|
|
|
|
elif chat_profile == 'Qwen1.5-32B': |
|
client = Client("Qwen/Qwen1.5-32B-Chat-demo", hf_token=hf_token) |
|
result = client.predict( |
|
query=message.content, |
|
system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/model_chat" |
|
) |
|
|
|
for i in list(result[1][0][1]): |
|
await msg.stream_token(i) |
|
|
|
|
|
elif chat_profile == 'Qwen1.5-2.7B': |
|
client = Client("Qwen/qwen1.5-MoE-A2.7B-Chat-demo", hf_token=hf_token) |
|
result = client.predict( |
|
query=message.content, |
|
system=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/model_chat" |
|
) |
|
|
|
for i in list(result[1][0][1]): |
|
await msg.stream_token(i) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif chat_profile == 'Llama-3.1-405B': |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
client = OpenAI( |
|
base_url = "https://integrate.api.nvidia.com/v1", |
|
api_key = nvidia_api_key |
|
) |
|
|
|
completion = client.chat.completions.create( |
|
model="meta/llama-3.1-405b-instruct", |
|
messages=[{"role":"user","content": message.content}], |
|
temperature=0.2, |
|
top_p=0.7, |
|
max_tokens=1024, |
|
stream=True |
|
) |
|
for chunk in completion: |
|
if chunk.choices[0].delta.content is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
|
|
elif chat_profile == 'Llama-3.1-70B': |
|
completion = groq_client.chat.completions.create( |
|
model="llama-3.1-70b-versatile", |
|
messages=[ |
|
{ |
|
"role": "user", |
|
"content": message.content |
|
} |
|
], |
|
temperature=1, |
|
max_tokens=1024, |
|
top_p=1, |
|
stream=True, |
|
stop=None, |
|
) |
|
|
|
|
|
|
|
|
|
for chunk in completion: |
|
|
|
|
|
if chunk is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
elif chat_profile == 'Llama-3.1-8B': |
|
completion = groq_client.chat.completions.create( |
|
model="llama-3.1-8b-instant", |
|
messages=[ |
|
{ |
|
"role": "user", |
|
"content": message.content |
|
} |
|
], |
|
temperature=1, |
|
max_tokens=1024, |
|
top_p=1, |
|
stream=True, |
|
stop=None, |
|
) |
|
|
|
for chunk in completion: |
|
|
|
|
|
if chunk is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
elif chat_profile == 'Llama-3-70B': |
|
completion = groq_client.chat.completions.create( |
|
model="llama3-70b-8192", |
|
messages=[ |
|
{ |
|
"role": "user", |
|
"content": message.content |
|
} |
|
], |
|
temperature=1, |
|
max_tokens=1024, |
|
top_p=1, |
|
stream=True, |
|
stop=None, |
|
) |
|
|
|
for chunk in completion: |
|
|
|
|
|
if chunk is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
elif chat_profile == 'Llama-3-8B': |
|
completion = groq_client.chat.completions.create( |
|
model="llama3-8b-8192", |
|
messages=[ |
|
{ |
|
"role": "user", |
|
"content": message.content |
|
} |
|
], |
|
temperature=1, |
|
max_tokens=1024, |
|
top_p=1, |
|
stream=True, |
|
stop=None, |
|
) |
|
|
|
for chunk in completion: |
|
|
|
|
|
if chunk is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
elif chat_profile == 'gemma2-27B': |
|
client = Client("gokaygokay/Gemma-2-llamacpp") |
|
stream_list = [] |
|
for token in client.predict( |
|
message=message.content, |
|
model="gemma-2-27b-it-Q5_K_M.gguf", |
|
system_message=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
max_tokens=2048, |
|
temperature=0.7, |
|
top_p=0.95, |
|
top_k=40, |
|
repeat_penalty=1.1, |
|
api_name="/chat" |
|
): |
|
stream_list.append(token) |
|
for res in stream_list: |
|
await msg.stream_token(res) |
|
|
|
elif chat_profile == 'gemma2-9B': |
|
completion = groq_client.chat.completions.create( |
|
model="gemma2-9b-it", |
|
messages=[ |
|
{ |
|
"role": "user", |
|
"content": message.content |
|
} |
|
], |
|
temperature=1, |
|
max_tokens=1024, |
|
top_p=1, |
|
stream=True, |
|
stop=None, |
|
) |
|
|
|
for chunk in completion: |
|
|
|
|
|
if chunk is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
|
|
elif chat_profile == 'gemma-7B': |
|
completion = groq_client.chat.completions.create( |
|
model="gemma-7b-it", |
|
messages=[ |
|
{ |
|
"role": "user", |
|
"content": message.content |
|
} |
|
], |
|
temperature=1, |
|
max_tokens=1024, |
|
top_p=1, |
|
stream=True, |
|
stop=None, |
|
) |
|
|
|
for chunk in completion: |
|
|
|
|
|
if chunk is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
elif chat_profile == "zephyr-7B": |
|
result = hf_text_client.predict( |
|
message=message.content, |
|
system_message=f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people", |
|
api_name="/chat" |
|
) |
|
for token in result: |
|
await msg.stream_token(token) |
|
|
|
elif chat_profile == 'mixtral-8x7B': |
|
completion = groq_client.chat.completions.create( |
|
model="mixtral-8x7b-32768", |
|
messages=[ |
|
{ |
|
"role": "user", |
|
"content": message.content |
|
} |
|
], |
|
temperature=1, |
|
max_tokens=1024, |
|
top_p=1, |
|
stream=True, |
|
stop=None, |
|
) |
|
|
|
for chunk in completion: |
|
|
|
|
|
if chunk is not None: |
|
await msg.stream_token(chunk.choices[0].delta.content) |
|
|
|
|
|
elif chat_profile == 'mistral-nemo-12B': |
|
client = Client("0x7o/Mistral-Nemo-Instruct", hf_token=hf_token) |
|
result = client.predict( |
|
message=message.content, |
|
max_new_tokens=512, |
|
temperature=0.7, |
|
top_p=0.95, |
|
api_name="/chat" |
|
) |
|
|
|
for i in result: |
|
await msg.stream_token(i) |
|
elif chat_profile == 'mistral-7B-v2': |
|
client = InferenceClient( |
|
"mistralai/Mistral-7B-Instruct-v0.2", |
|
token=f"{hf_token_llama_3_1}", |
|
) |
|
for res in client.chat_completion( |
|
messages=[{"role": "user", "content": message.content}], |
|
max_tokens=500, |
|
stream=True, |
|
): |
|
if res.choices[0].delta.content is not None: |
|
await msg.stream_token(res.choices[0].delta.content) |
|
|
|
elif chat_profile == 'Yi-1.5-34B': |
|
final_answer = await cl.Message(content="").send() |
|
client = InferenceClient( |
|
"01-ai/Yi-1.5-34B-Chat", |
|
token=f'{hf_token_llama_3_1}', |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg = cl.Message(content="") |
|
await msg.send() |
|
for message in client.chat_completion( |
|
messages=[{"role": "user", "content": message.content}], |
|
max_tokens=500, |
|
stream=True, |
|
): |
|
tokens_list = [] |
|
tokens_list.append(message.choices[0].delta.content) |
|
for token in tokens_list: |
|
if token != "": |
|
await msg.stream_token(token) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif chat_profile == 'Aya-23B': |
|
stream = co.chat_stream( |
|
model='c4ai-aya-23', |
|
message=message.content, |
|
temperature=0.3, |
|
|
|
prompt_truncation='OFF', |
|
connectors=[], |
|
) |
|
|
|
|
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
|
|
|
|
elif chat_profile == 'Aya-35B': |
|
stream = co.chat_stream( |
|
model='c4ai-aya-23', |
|
message=message.content, |
|
temperature=0.3, |
|
|
|
prompt_truncation='OFF', |
|
connectors=[], |
|
) |
|
|
|
complete_content = '' |
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
|
|
elif chat_profile == 'Command-R-Plus': |
|
stream = co.chat_stream( |
|
model='command-r-plus', |
|
message=message.content, |
|
temperature=0.3, |
|
chat_history=[], |
|
prompt_truncation='AUTO', |
|
) |
|
complete_content = '' |
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
|
|
elif chat_profile == 'Command-R': |
|
stream = co.chat_stream( |
|
model='command-r', |
|
message=message.content, |
|
temperature=0.3, |
|
chat_history=[], |
|
prompt_truncation='AUTO', |
|
) |
|
complete_content = '' |
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
|
|
elif chat_profile == 'Command': |
|
stream = co.chat_stream( |
|
model='command', |
|
message=message.content, |
|
temperature=0.3, |
|
chat_history=[], |
|
prompt_truncation='AUTO', |
|
) |
|
complete_content = '' |
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
|
|
elif chat_profile == 'Command-Light': |
|
stream = co.chat_stream( |
|
model='command-light', |
|
message=message.content, |
|
temperature=0.3, |
|
chat_history=[], |
|
prompt_truncation='AUTO', |
|
) |
|
complete_content = '' |
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
elif chat_profile == 'Command-Light-Nightly': |
|
stream = co.chat_stream( |
|
model='command-light-nightly', |
|
message=message.content, |
|
temperature=0.3, |
|
chat_history=[], |
|
prompt_truncation='AUTO', |
|
) |
|
complete_content = '' |
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
|
|
elif chat_profile == 'Command-Nightly': |
|
stream = co.chat_stream( |
|
model='command-light-nightly', |
|
message=message.content, |
|
temperature=0.3, |
|
chat_history=[], |
|
prompt_truncation='AUTO', |
|
) |
|
complete_content = '' |
|
for event in stream: |
|
if event.event_type == 'text-generation': |
|
await msg.stream_token(event.text) |
|
|
|
@cl.on_settings_update |
|
async def setup_agent(settings): |
|
print("on_settings_update", settings) |