HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/multimodal/app.py
import streamlit as st
import requests
import json
import time
from streamlit_webrtc import webrtc_streamer
def main():
    st.title("Gemini 2.0 Multimodal App")

    # Authentication
    code = st.text_input("Enter Code")

    if code:
        # Load system prompt based on code
        if code == "prompt1":
            system_prompt = "You are a helpful assistant. Answer questions in a clear and concise way."
        elif code == "prompt2":
            system_prompt = "You are a creative writer. Write a poem about a lonely cloud."
        else:
            system_prompt = "Invalid code. Please try again."

        if system_prompt != "Invalid code. Please try again.":
            # Initialize Gemini API session
            url = "https://api.gemini.google.com/v1/models/gemini-2.0-multimodal-live:generate"
            headers = {
                "Authorization": "Bearer YOUR_API_KEY",
                "Content-Type": "application/json"
            }

            # Streamlit WebRTC for video/audio input
            webrtc_ctx = webrtc_streamer(
                key="example",
                video_processor_factory=VideoProcessor,
                audio_processor_factory=AudioProcessor,
            )

            if webrtc_ctx.state.playing:
                # Send prompt and media to Gemini API
                data = {
                    "inputs": {
                        "text": system_prompt,
                        "audio": webrtc_ctx.state.audio,
                        "video": webrtc_ctx.state.video
                    },
                    "temperature": 0.7
                }

                response = requests.post(url, headers=headers, json=data, stream=True)

                for line in response.iter_lines():
                    if line:
                        decoded_line = line.decode('utf-8')
                        st.write(decoded_line)
                        time.sleep(0.5)  # Adjust delay as needed

class VideoProcessor:
    def recv(self, frame):
        # Process video frame if needed
        return frame

class AudioProcessor:
    def recv(self, frame):
        # Process audio frame if needed
        return frame

if __name__ == '__main__':
    main()