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.inbound import TranscriptMessage

# Create an app instance with your API key
app = App(api_key="your_api_key_here", host="backendapi.framewise.ai", port=443)

# 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", host="backendapi.framewise.ai", port=443)

# Or set API key later
app = App(host="backendapi.framewise.ai", port=443)
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.7.tar.gz (98.7 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.7-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: framewise_meet_client-0.1.7.tar.gz
  • Upload date:
  • Size: 98.7 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.7.tar.gz
Algorithm Hash digest
SHA256 51b22c28597ca2a3c79bda6bda89d11dc9b96ca89792e09f89265b3b8f15884a
MD5 3917323759687238bc6509bd236072f0
BLAKE2b-256 93579f6903a03811fcd5d4144bc44cd83e37beb3ea4cb138b5773e6c047484cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for framewise_meet_client-0.1.7.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.7-py3-none-any.whl.

File metadata

File hashes

Hashes for framewise_meet_client-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a7171db52ab00afb6759006ea036f9e898103dad36d6c11a4364b784ee720a79
MD5 f66312ebcc19ff380d7eed0dab82ec79
BLAKE2b-256 a852173ec947eb8a32b84e8544a831b9ef4b85835b46ad847503798781ed8c1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for framewise_meet_client-0.1.7-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