Skip to main content

Sinapsis templates for shared chatbot foundations.

Project description



Sinapsis Chatbots Base

Sinapsis templates for chatbot inputs, contextualization, and endpoint 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 requires 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.

[!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.0.tar.gz (31.2 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.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for sinapsis_chatbots_base-0.2.0.tar.gz
Algorithm Hash digest
SHA256 07b9fda069106bfe7515d7f744aa42709e9b841629dc83f01c52efa7e047664b
MD5 adaeac8434cc0b4356a713343f62c612
BLAKE2b-256 c7beafeb1ac8701969f9533ec9cca490b4f3677db555a04c27017f846fab8da9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sinapsis_chatbots_base-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c0ca14a1434182c80dcb89312dce606e1e6280047a7c2afabf1a07a56e464fb
MD5 89e59bcc0c0b07726c404f7e240cf8fa
BLAKE2b-256 a017134516755a76b776ee2ccc474ba5e655115cb0029f1f01da77c1fabbb4b3

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