Skip to main content

start_chat_server

Function
This function is defined in the chat module.
Start the PraisonAI Chat server.

Signature

def start_chat_server(agent: Optional[Any], agents: Optional[list], config: Optional[ChatConfig], port: int, host: str, debug: bool) -> None

Parameters

agent
Optional
A single PraisonAI agent to use in the chat.
agents
Optional
A list of PraisonAI agents for multi-agent chat.
config
Optional
ChatConfig object with server settings.
port
int
default:"8000"
Port to run the server on (default: 8000).
host
str
default:"'0.0.0.0'"
Host to bind to (default: 0.0.0.0).
debug
bool
default:"False"
Enable debug mode (default: False).

Usage

>>> from praisonaiagents import Agent
    >>> from praisonai.chat import start_chat_server
    >>> 
    >>> agent = Agent(name="Assistant", instructions="You are helpful.")
    >>> start_chat_server(agent=agent, port=8000)