Skip to main content

Sinapsis templates for shared chatbot foundations.

Project description



Sinapsis Chatbots Base

Sinapsis templates for chatbot inputs, contextualization, and endpoint-backed completions.

🐍 Installation🚀 Features📚 Usage example📙 Documentation🔍 License

The sinapsis-chatbots-base package provides the shared chatbot foundation. It includes the base abstractions for LLM templates together with the core templates for building LLMConversationPacket inputs, adding document context from preloaded data, and sending chat requests to OpenAI-compatible HTTP endpoints.

🐍 Installation

Install using your preferred package manager. We strongly recommend using uv.

Install the base package:

uv pip install sinapsis-chatbots-base --extra-index-url https://pypi.sinapsis.tech

Or with raw pip:

pip install sinapsis-chatbots-base --extra-index-url https://pypi.sinapsis.tech

[!IMPORTANT] EndpointLLMCompletion and EndpointLLMCompletionWithMCP require the optional endpoint extra:

uv pip install sinapsis-chatbots-base[endpoint] --extra-index-url https://pypi.sinapsis.tech

all installs every optional dependency exposed by the package:

uv pip install sinapsis-chatbots-base[all] --extra-index-url https://pypi.sinapsis.tech

🚀 Features

Templates Supported

  • LLMConversationInput: Creates an LLMConversationPacket from a prompt, system prompt, and packet metadata.
  • QueryContextualizeFromFile: Builds packet contexts from files or documents already loaded into the container.
  • EndpointLLMCompletion: Sends chat requests to OpenAI-compatible endpoints such as OpenAI, Ollama, llama.cpp server, vLLM server, or compatible hosted APIs.
  • EndpointLLMCompletionWithMCP: Adds MCP tool support on top of EndpointLLMCompletion for OpenAI-compatible endpoints.
  • EndpointLLMStreamingCompletion: Streams chat-completion chunks from OpenAI-compatible endpoints and emits partial packet updates.
  • EndpointLLMMultiModal: Sends text + image user turns to OpenAI-compatible multimodal endpoints.

[!NOTE] EndpointLLMCompletionWithMCP is currently validated for llama.cpp served Qwen 3.5 models and other OpenAI-compatible endpoints may also work depending on tool-calling behavior.

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis Chatbots Base.

📚 Usage example

The following agent builds an LLMConversationPacket and sends it to an OpenAI-compatible endpoint.

Config
agent:
  name: openai_api_agent

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name: LLMConversationInput
    class_name: LLMConversationInput
    template_input: InputTemplate
    attributes:
      prompt: Give three short tips for staying organized during a busy week.
      system_prompt: You are a helpful assistant.

  - template_name: EndpointLLMCompletion
    class_name: EndpointLLMCompletion
    template_input: LLMConversationInput
    attributes:
      init_args:
        base_url: "https://api.openai.com/v1"
        llm_model_name: "gpt-4o-mini"
      completion_args:
        max_tokens: 2048

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinapsis_chatbots_base-0.2.2.tar.gz (42.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinapsis_chatbots_base-0.2.2-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_chatbots_base-0.2.2.tar.gz.

File metadata

File hashes

Hashes for sinapsis_chatbots_base-0.2.2.tar.gz
Algorithm Hash digest
SHA256 bf6e7f371a2890ee90b8cdd666882c45d7491b7397aa4bdd2d46bef77b72bb04
MD5 9d6258b8fd87db8645c31287997649d4
BLAKE2b-256 48190897bcd4e6fb5de3af1b78ec4b83a0cb655bfea9e58b4ab21590cbf6b1c0

See more details on using hashes here.

File details

Details for the file sinapsis_chatbots_base-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_chatbots_base-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8e9c67007917dbcef039044e58994ca7eb179f31399e27ce5a6f8dbf9851aa95
MD5 a1a9cd16eb5d41d36b1a0f6c2b364959
BLAKE2b-256 458d3d0ff9f96d82cfdab59621393549d94c542eb681ec44fd697a2f13a0a49d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page