Skip to main content

Add your description here

Project description

Framewise Meet Client

A Python client library for building interactive applications with the Framewise API.

Table of Contents

Installation

Install the package using pip:

pip install framewise-meet-client

Quick Start

from framewise_meet_client import App
from framewise_meet_client.models.messages import TranscriptMessage

# Create an app instance with your API key
app = App(api_key="your_api_key_here")

# Join a meeting
app.join_meeting("your_meeting_id")

# Handle transcript events
@app.on_transcript()
def handle_transcript(message: TranscriptMessage):
    print(f"Received transcript: {message.content.text}")
    if message.content.is_final:
        print("This is a final transcript")

# Run the app
if __name__ == "__main__":
    app.run()

Core Features

Authentication

The client supports API key authentication:

# Initialize with API key
app = App(api_key="your_api_key_here")

# Or set API key later
app = App()
app.set_api_key("your_api_key_here")

Event Handlers

Register handlers for different event types using the decorator pattern:

Typed Event Handlers

# Transcript events
@app.on_transcript()
def handle_transcript(message: TranscriptMessage):
    print(f"Transcript: {message.content.text}")

# Join events
@app.on_join()
def handle_join(message: JoinMessage):
    print(f"User joined: {message.content.user.name}")

# Exit events
@app.on_exit()
def handle_exit(message: ExitMessage):
    print(f"User left: {message.content.user.name}")

# MCQ selection events
@app.on_mcq_selection()
def handle_selection(message: MCQSelectionMessage):
    print(f"Selected option: {message.content.selectedOption}")

Generic Event Handlers

# Using string event type
@app.on("transcript")
def handle_any_transcript(message):
    print(f"Generic handler: {message.content.text}")

# Using invoke for final transcripts
@app.invoke
def process_command(message: TranscriptMessage):
    if message.content.is_final:
        print(f"Processing command: {message.content.text}")
        app.send_text(f"Received command: {message.content.text}")

Sending Responses

The client provides several methods to send different types of content:

# Send plain text
app.send_text("Hello world!")

# Send generated text with streaming support
app.send_generated_text("Starting to generate content...", is_generation_end=False)
app.send_generated_text("Here's the complete response!", is_generation_end=True)

# Send notifications with different levels
app.send_notification("Operation completed", level="info", duration=5000)

# Send custom UI elements
app.send_custom_ui_element("card", {
    "title": "Important Information",
    "content": "This is a custom card element",
    "buttons": ["OK", "Cancel"]
})

Multiple-Choice Questions (MCQs)

Create interactive polls and quizzes:

# Send an MCQ question
app.send_mcq_question(
    question_id="quiz-1",
    question="What is the capital of France?",
    options=["Paris", "London", "Berlin", "Madrid"]
)

# Handle MCQ responses
@app.on_mcq_selection()
def handle_mcq_response(message):
    question_id = message.content.questionId
    selected_option = message.content.selectedOption
    selected_index = message.content.selectedIndex
    user = message.content.user
    
    print(f"User {user.name} selected {selected_option} (index: {selected_index}) for question {question_id}")
    
    # Send acknowledgment
    if selected_option == "Paris":
        app.send_text("Correct!")
    else:
        app.send_text("Incorrect. The answer is Paris.")

Custom UI Elements

Display custom interface components:

# Send a custom card element
app.send_custom_ui_element("card", {
    "title": "Weather Forecast",
    "content": "Today will be sunny with a high of 75°F",
    "image": "https://example.com/weather.png",
    "buttons": ["View Details", "Dismiss"]
})

# Handle UI element interactions
@app.on_custom_ui()
def handle_ui_interaction(message):
    ui_type = message.content.uiType
    action = message.content.action
    data = message.content.data
    
    print(f"UI interaction: type={ui_type}, action={action}, data={data}")

Specific UI Element Handlers

# Handle specific UI element types
@app.on_custom_ui(ui_type="card")
def handle_card_interaction(message):
    print(f"Card interaction: {message.content.action}")
    
    if message.content.action == "button_click" and message.content.data["button"] == "View Details":
        app.send_text("Showing detailed weather forecast...")

Advanced Features

Meeting Management

Create and manage meetings programmatically:

# Create a new meeting
meeting_data = app.create_meeting(
    meeting_id="team_meeting_123",
    start_time_utc="2023-08-15T14:00:00Z",
    end_time_utc="2023-08-15T15:00:00Z"
)

# Join the newly created meeting
app.join_meeting(meeting_id=meeting_data["meeting_id"])

Logging Configuration

Configure logging when running the app:

# Set logging level
app.run(log_level="DEBUG")  # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL

# Configure auto-reconnect behavior
app.run(auto_reconnect=True, reconnect_delay=5)

API Reference

For complete API documentation, visit https://docs.framewise.ai/docs/

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

framewise_meet_client-0.1.5.tar.gz (766.9 kB view details)

Uploaded Source

Built Distribution

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

framewise_meet_client-0.1.5-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file framewise_meet_client-0.1.5.tar.gz.

File metadata

  • Download URL: framewise_meet_client-0.1.5.tar.gz
  • Upload date:
  • Size: 766.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for framewise_meet_client-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6cd29ec63b86cd89806c40410fce75e0d0139aacaef81568ab1edbbc9d30a1a1
MD5 8092354aeb4d7b28d68ba702a40eeaa6
BLAKE2b-256 2e44304c105f3cad18bccc58d8fe8bdc886c525f25d1eb05b04329ac4f806d5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for framewise_meet_client-0.1.5.tar.gz:

Publisher: python-publish.yml on Framewise-AI/framewise_meet_client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file framewise_meet_client-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for framewise_meet_client-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e1e98fb7f6e3ae37be7028db2b74420af78165a66728bcbc3b7bae198485febd
MD5 27f4df5ece46f881f587dff26ec0e80a
BLAKE2b-256 b8b0773abf4a06eab68f51c87ab90fa75ce55a6e40eee093068672b0f72ef281

See more details on using hashes here.

Provenance

The following attestation bundles were made for framewise_meet_client-0.1.5-py3-none-any.whl:

Publisher: python-publish.yml on Framewise-AI/framewise_meet_client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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