Spaces:
Sleeping
Sleeping
Update pipeline.py
Browse files- pipeline.py +17 -0
pipeline.py
CHANGED
|
@@ -13,7 +13,24 @@ from smolagents import CodeAgent, DuckDuckGoSearchTool, ManagedAgent, LiteLLMMod
|
|
| 13 |
import subprocess # Import subprocess to run shell commands
|
| 14 |
from langchain.llms.base import LLM # Import LLM
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Initialize Mistral agent using Pydantic AI
|
|
|
|
| 17 |
mistral_api_key = os.environ.get("MISTRAL_API_KEY") # Ensure your Mistral API key is set
|
| 18 |
mistral_model = MistralModel("mistral-large-latest", api_key=mistral_api_key) # Use a Mistral model
|
| 19 |
mistral_agent = Agent(mistral_model)
|
|
|
|
| 13 |
import subprocess # Import subprocess to run shell commands
|
| 14 |
from langchain.llms.base import LLM # Import LLM
|
| 15 |
|
| 16 |
+
from classification_chain import get_classification_chain
|
| 17 |
+
from refusal_chain import get_refusal_chain
|
| 18 |
+
from tailor_chain import get_tailor_chain
|
| 19 |
+
from cleaner_chain import get_cleaner_chain, CleanerChain
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
# 1) Environment: set up keys if missing
|
| 23 |
+
if not os.environ.get("GEMINI_API_KEY"):
|
| 24 |
+
os.environ["GEMINI_API_KEY"] = getpass.getpass("Enter your Gemini API Key: ")
|
| 25 |
+
if not os.environ.get("GROQ_API_KEY"):
|
| 26 |
+
os.environ["GROQ_API_KEY"] = getpass.getpass("Enter your GROQ API Key: ")
|
| 27 |
+
if not os.environ.get("MISTRAL_API_KEY"):
|
| 28 |
+
os.environ["MISTRAL_API_KEY"] = getpass.getpass("Enter your Mistral API Key: ")
|
| 29 |
+
|
| 30 |
+
# Initialize Mistral client
|
| 31 |
+
mistral_client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
|
| 32 |
# Initialize Mistral agent using Pydantic AI
|
| 33 |
+
|
| 34 |
mistral_api_key = os.environ.get("MISTRAL_API_KEY") # Ensure your Mistral API key is set
|
| 35 |
mistral_model = MistralModel("mistral-large-latest", api_key=mistral_api_key) # Use a Mistral model
|
| 36 |
mistral_agent = Agent(mistral_model)
|