Skip to main content

Beta Features

Agentic Chat

Here you can get a preview of what we are currently exploring in Assistant Chat.

important

This is an experimental beta feature; some capabilities may be incomplete or occasionally error-prone

How to access

Enable by toggling “Try something new” inside Assisstant Chat Application Template.

Features

Chat with Agentic Apps

Describe what you need in your own words, even complex requests. Our AI understands your goal and automatically coordinates the necessary agents/apps to get it done.

The agentic chat seamlessly combines multiple tasks in a single request for a single output which makes it reliable for complex workflows.

The following agents/apps are available for you to use and try as an experiment:

  • Translation
  • Summarisation
  • OpenWeather API (If configured with an API key)

Revised design

A stripped down interface that includes new features such as token streaming.

Configuration

This document provides a comprehensive reference for all configuration options available in the Pharia Chat Service. All settings can be configured for this Beta feature using environment variables with the prefix PHARIA_CHAT_.

Core Settings

Environment VariableTypeDefaultDescription
PHARIA_CHAT_DEBUGbooleanfalseEnable debug mode which returns exception details
PHARIA_CHAT_CORS_ORIGINSlist[str] or str["*"]List of allowed CORS origins. Use '*' to allow all origins during development
PHARIA_CHAT_REASONING_MODELstring"llama-3.3-70b-instruct"The model to use for agent reasoning
PHARIA_CHAT_SUMMARIZATION_MODELstringnullModel used for conversation summarization. If not set, REASONING_MODEL is used
PHARIA_CHAT_MAX_TOOL_RETRIESinteger1Maximum number of retries for tool calls before giving up
PHARIA_CHAT_PHOENIX_TRACING_ENABLEDbooleanfalseEnable all tracing functionality

Authentication Settings

Environment VariableTypeDefaultDescription
PHARIA_CHAT_AUTHENTICATION_ISSUER_URLstring"https://login.product.pharia.com"URL of the authentication issuer
PHARIA_CHAT_DEBUG_DEVELOPER_TOKENstringnullDeveloper token for debugging purposes

Inference API Settings

Environment VariableTypeDefaultDescription
PHARIA_CHAT_PHARIA_TOKENstringnullAuthentication token for Pharia services
PHARIA_CHAT_INFERENCE_URLstring"https://inference-api.product.pharia.com"URL for the inference API
PHARIA_CHAT_INFERENCE_BACKENDstring"aleph_alpha"The inference backend to use (aleph_alpha, openai, or openrouter)

OpenRouter Settings

Environment VariableTypeDefaultDescription
PHARIA_CHAT_OPENROUTER_API_KEYstringnullAPI key for OpenRouter
PHARIA_CHAT_OPENROUTER_URLstring"https://openrouter.ai/api/v1"URL for OpenRouter API

Tool Settings

Environment VariableTypeDefaultDescription
PHARIA_CHAT_OPENWEATHER_API_KEYstringnullAPI key for OpenWeather service, see https://openweathermap.org/api
PHARIA_CHAT_PHARIA_ASSISTANT_API_URLstringnullBase URL for Pharia Assistant API (for translate and summarize tools)

Service URLs

Environment VariableTypeDefaultDescription
PHARIA_CHAT_URLS__SUMMARYstring"https://pharia-assistant.product.pharia.com/api/summary/raw"URL for the summary service
PHARIA_CHAT_URLS__TRANSLATEstring"https://pharia-assistant.product.pharia.com/api/translate"URL for the translation service
PHARIA_CHAT_URLS__OPENWEATHERMAPstring"https://api.openweathermap.org/data/2.5/weather"URL for the OpenWeatherMap API

Database Settings

All database settings use the prefix PHARIA_CHAT_DB__.

Environment VariableTypeDefaultDescription
PHARIA_CHAT_DB__HOSTstring"127.0.0.1"Database host
PHARIA_CHAT_DB__PORTinteger5432Database port
PHARIA_CHAT_DB__USERstring"postgres"Database user
PHARIA_CHAT_DB__PASSWORDstring"postgres"Database password
PHARIA_CHAT_DB__DATABASEstring"postgres"Database name
PHARIA_CHAT_DB__POOL_SIZEinteger75Connection pool size
PHARIA_CHAT_DB__MAX_OVERFLOWinteger20Maximum number of connections to overflow
PHARIA_CHAT_DB__ECHObooleanfalseEcho SQL statements to stdout
PHARIA_CHAT_DB__MAX_TX_RETRY_COUNTinteger3Maximum number of transaction retry attempts
PHARIA_CHAT_DB__DSNstringnullFull database connection string (if provided, overrides individual settings)
PHARIA_CHAT_DB__AUTO_MIGRATIONbooleanfalseAutomatically run Alembic migrations on application startup

Logging Settings

All logging settings use the prefix PHARIA_CHAT_LOGGING__.

Environment VariableTypeDefaultDescription
PHARIA_CHAT_LOGGING__LEVELstring"INFO"Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
PHARIA_CHAT_LOGGING__MODULE_LEVELSdict[str, str]{"pharia.chat.api.main": "DEBUG"}Module-specific log levels
PHARIA_CHAT_LOGGING__JSON_OUTPUTbooleanfalseOutput logs as JSON (useful for production) instead of human-readable format
PHARIA_CHAT_LOGGING__INCLUDE_CALLSITE_INFObooleanfalseInclude file, function, and line number in logs (reduces performance)
PHARIA_CHAT_LOGGING__FILE_PATHstringnullPath to log file. If not set, logs will only go to stdout
PHARIA_CHAT_LOGGING__FILE_LEVELstringnullLogging level for file handler. Defaults to the same as 'level'

Example Configuration

Here's an example of a complete configuration using environment variables:

# Core settings
PHARIA_CHAT_DEBUG=true
PHARIA_CHAT_CORS_ORIGINS='["[https://app.example.com](https://app.example.com)","[https://admin.example.com](https://admin.example.com)"]'
PHARIA_CHAT_REASONING_MODEL="llama-3.3-70b-instruct"
PHARIA_CHAT_MAX_TOOL_RETRIES=3

# Authentication
PHARIA_CHAT_AUTHENTICATION_ISSUER_URL="[https://login.example.com](https://login.example.com)"
PHARIA_CHAT_DEBUG_DEVELOPER_TOKEN="dev_token_for_testing"

# Inference API
PHARIA_CHAT_PHARIA_TOKEN="your_pharia_token_here"
PHARIA_CHAT_INFERENCE_URL="[https://inference-api.example.com](https://inference-api.example.com)"
PHARIA_CHAT_INFERENCE_BACKEND="openai"

# OpenRouter
PHARIA_CHAT_OPENROUTER_API_KEY="your_openrouter_key_here"
PHARIA_CHAT_OPENROUTER_URL="[https://openrouter.ai/api/v1](https://openrouter.ai/api/v1)"

# Tools
PHARIA_CHAT_OPENWEATHER_API_KEY="your_openweather_api_key"
PHARIA_CHAT_PHARIA_ASSISTANT_API_URL="[https://assistant.example.com/api](https://assistant.example.com/api)"

# Service URLs
PHARIA_CHAT_URLS__SUMMARY="[https://assistant.example.com/api/summary/raw](https://assistant.example.com/api/summary/raw)"
PHARIA_CHAT_URLS__TRANSLATE="[https://assistant.example.com/api/translate](https://assistant.example.com/api/translate)"
PHARIA_CHAT_URLS__OPENWEATHERMAP="[https://api.openweathermap.org/data/2.5/weather](https://api.openweathermap.org/data/2.5/weather)"

# Database
PHARIA_CHAT_DB__HOST=db.example.com
PHARIA_CHAT_DB__PORT=5432
PHARIA_CHAT_DB__USER=app_user
PHARIA_CHAT_DB__PASSWORD=secure_password
PHARIA_CHAT_DB__DATABASE=pharia_chat
PHARIA_CHAT_DB__POOL_SIZE=100
PHARIA_CHAT_DB__ECHO=true
PHARIA_CHAT_DB__AUTO_MIGRATION=true

# Logging
PHARIA_CHAT_LOGGING__LEVEL=INFO
PHARIA_CHAT_LOGGING__MODULE_LEVELS='{"pharia.chat.api.routes": "DEBUG", "pharia.chat.agents": "DEBUG"}'
PHARIA_CHAT_LOGGING__JSON_OUTPUT=true
PHARIA_CHAT_LOGGING__INCLUDE_CALLSITE_INFO=true
PHARIA_CHAT_LOGGING__FILE_PATH=/var/log/pharia-chat/app.log
PHARIA_CHAT_LOGGING__FILE_LEVEL=WARNING

Configuration Precedence

Configuration values are loaded in the following order of precedence (highest to lowest):

  1. Environment variables
  2. .env file in the project root
  3. Default values defined in the code

Notes on Special Types

  • Boolean values: Use true or false (case-insensitive).
  • Lists: Can be provided as JSON strings, e.g., '["item1", "item2"]'.
  • Dictionaries: Can be provided as JSON strings, e.g., '{"key1": "value1", "key2": "value2"}'.
  • Nested settings: Use double underscores (__) to denote nesting, e.g., PHARIA_CHAT_DB__HOST.