
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
st-chat-input-multimodal
Advanced tools
Streamlit multimodal chat input component with text, image, and voice support
A multimodal chat input component for Streamlit that supports text input, image upload, and voice input.
Note: Voice and image features require HTTPS or localhost environment to function properly.
pip install st-chat-input-multimodal
import streamlit as st
from st_chat_input_multimodal import multimodal_chat_input
# Basic usage
result = multimodal_chat_input()
if result:
# Display text
if result['text']:
st.write(f"Text: {result['text']}")
# Display uploaded files
if result['files']:
for file in result['files']:
import base64
base64_data = file['data'].split(',')[1]
image_bytes = base64.b64decode(base64_data)
st.image(image_bytes, caption=file['name'])
# Display voice input metadata
if result.get('audio_metadata'):
st.write(f"Voice input used: {result['audio_metadata']['used_voice_input']}")
# Enable voice input
result = multimodal_chat_input(
enable_voice_input=True,
voice_recognition_method="web_speech", # or "openai_whisper"
voice_language="ja-JP",
max_recording_time=60
)
# Using OpenAI Whisper API
result = multimodal_chat_input(
enable_voice_input=True,
voice_recognition_method="openai_whisper",
openai_api_key="sk-your-api-key",
voice_language="ja-JP"
)
result = multimodal_chat_input(
placeholder="Please enter your message...",
max_chars=500,
accepted_file_types=["jpg", "png", "gif", "webp"],
max_file_size_mb=10,
disabled=False,
key="custom_chat_input"
)
import streamlit as st
import base64
from st_chat_input_multimodal import multimodal_chat_input
# Page configuration
st.set_page_config(
page_title="Multimodal Chat Input Demo",
page_icon="💬",
layout="wide"
)
st.subheader("💭 Multimodal Chat Input Demo")
st.markdown("Simulate a chat application with voice input and file upload.")
# Manage history in session state
if "chat_history" not in st.session_state:
st.session_state.chat_history = []
# Input for new messages
chat_result = multimodal_chat_input(
placeholder="Enter chat message...",
enable_voice_input=True, # Enable voice input for chat as well
key="chat_input"
)
if chat_result:
st.session_state.chat_history.append(chat_result)
# Display chat history
if st.session_state.chat_history:
for i, message in enumerate(st.session_state.chat_history):
with st.chat_message("user"):
if message.get("text"):
st.write(message["text"])
if message.get("files"):
for file in message["files"]:
try:
base64_data = file['data'].split(',')[1] if ',' in file['data'] else file['data']
image_bytes = base64.b64decode(base64_data)
st.image(image_bytes, caption=file['name'], width=200)
except:
st.write(f"📎 {file['name']}")
# Display voice input information
if message.get("audio_metadata") and message["audio_metadata"]["used_voice_input"]:
st.caption(f"🎤 Voice input ({message['audio_metadata']['transcription_method']})")
# Clear history
if st.button("Clear History"):
st.session_state.chat_history = []
st.rerun()
MIT License
tsuzukia21
FAQs
Streamlit multimodal chat input component with text, image, and voice support
We found that st-chat-input-multimodal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.