Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Package deprecated

ConfidentialMind App / Playgroundutils

Overview

The ConfidentialMind App package (also known as playgroundutils) is a Python library designed to simplify the development of secure generative AI applications on the ConfidentialMind stack. It provides utility functions and components for building Streamlit-based front-end applications that interact with Large Language Models (LLMs) and other services within the ConfidentialMind ecosystem.

Features

  • Streamlit application initialization and configuration
  • Tool selector for managing multiple tools within a single application
  • Chat UI component for interacting with LLMs
  • Streaming handler for real-time LLM responses
  • User authentication and token management
  • LLM API interaction helpers

Installation

To install the package, add the following to your requirements.txt file:

pip install playgroundutils

Usage

Initializing a Streamlit App

from playgroundutils.app import init_streamlit_app

def main():
    APP_NAME = "My ConfidentialMind App"
    init_streamlit_app(APP_NAME)

    # Your app code here

if __name__ == "__main__":
    main()

Creating a Tool Selector

from playgroundutils.app import tool_selector
from confidentialmindserver.config_manager import BaseToolConfig

def parse_tools_config(tools):
    # Your tool parsing logic here
    pass

tools = [BaseToolConfig(...), BaseToolConfig(...)]
tool_selector(tools, parse_tools_config, APP_NAME)

Implementing a Chat UI

from playgroundutils.components import chat_ui

LLM_CONFIG_ID = "your_llm_config_id"
chat_ui(LLM_CONFIG_ID, system_prompt="You are a helpful assistant.")

Handling LLM API Requests

from playgroundutils.llm_api_helpers import LLMAPIHandler, ChatMessage
from playgroundutils.streaming import StreamHandler

llm_api_handler = LLMAPIHandler(LLM_CONFIG_ID)
stream_handler = StreamHandler(st.empty())

messages = [ChatMessage(role="user", content="Hello, AI!")]
response = llm_api_handler.handle_query(messages, stream_handler, temperature=0.7, stream=True)

Components

  • app.py: Contains functions for initializing Streamlit apps and managing tool selection.
  • components.py: Provides UI components like the chat interface.
  • llm_api_helpers.py: Handles interactions with LLM APIs.
  • streaming.py: Manages streaming responses from LLMs.
  • user.py: Handles user authentication and token management.

Configuration

The package works in conjunction with the ConfidentialMind server package to manage configurations and connectors. Make sure to set up your ConfigManager and define necessary connectors as described in the main ConfidentialMind SDK documentation.

Local Development

To run your Streamlit application locally using this package:

export CONFIDENTIAL_MIND_LOCAL_CONFIG="True"
export CONFIDENTIAL_MIND_LOCAL_DEV="True"
streamlit run your_app.py

Note

This package is designed to work within the ConfidentialMind ecosystem. Make sure you have the necessary permissions and access to the ConfidentialMind stack before using this package.

For more detailed information on the ConfidentialMind SDK and its capabilities, please refer to the main SDK documentation.

Release files for playgroundutils 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for playgroundutils 0.1.1
File Interpreter ABI Platform
playgroundutils-0.1.1-py3-none-any.whl Python 3 none any Details

Release files / playgroundutils-0.1.1-py3-none-any.whl

Download URL playgroundutils-0.1.1-py3-none-any.whl
Size 341.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d149653ddb5c99df76291653e85ce685f1a6482aed26b18ffc4914352d5ad10b
BLAKE2b-256 checksum
How to use checksums
fb1351737519cc6ca91754ead382af9e0a9ceeffb3727f922d656a949eccbcee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page