We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to upload any of examples in the repo to the pipelines settings tab. But when I try to save I get the error: No valves to update.
Can somebody point to what might be going on? Thank you.
Allow me show my code for context:
from typing import List, Union, Generator, Iterator import os from pydantic import BaseModel import requests class Pipeline: class Valves(BaseModel): AGENT_HOST: str AGENT_PORT: int AGENT_ENDPOINT:str pipelines: List[str] = [] priority: int = 0 # Update valves/ environment variables based on your selected database def __init__(self): self.name = "Xerket Chat" # Initialize self.valves = self.Valves( **{ # "pipelines": ["*"], # Connect to all pipelines "AGENT_HOST": os.getenv("AGENT_HOST", "0.0.0.0"), "AGENT_PORT": os.getenv("AGENT_PORT", 5006), "AGENT_ENDPOINT": os.getenv("AGENT_ENDPOINT", "/message"), } ) async def on_startup(self): # # This function is called when the server is started. pass async def on_shutdown(self): pass def pipe( self, user_message: str, model_id: str, messages: List[dict], body: dict ) -> Union[str, Generator, Iterator]: AGENT_ENDPOINT = self.valves.AGENT_ENDPOINT AGENT_PORT = self.valves.AGENT_PORT AGENT_HOST = self.valves.AGENT_HOST url = f"http://{AGENT_HOST}:{AGENT_PORT}{AGENT_ENDPOINT}" data = {"content": user_message} response = requests.post(url, json=data) agent_response = "" if response.status_code == 200: agent_response = response.json['response'] else: agent_response = "Agent not available" return agent_response
The text was updated successfully, but these errors were encountered:
My guess is you need to have this function defined?
async def on_valves_updated(self): # This function is called when the valves are updated. pass
Sorry, something went wrong.
No branches or pull requests
I'm trying to upload any of examples in the repo to the pipelines settings tab. But when I try to save I get the error: No valves to update.
Can somebody point to what might be going on? Thank you.
Allow me show my code for context:
The text was updated successfully, but these errors were encountered: