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")
# 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file framewise_meet_client-0.1.6.tar.gz.
File metadata
- Download URL: framewise_meet_client-0.1.6.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31966ff7ee72ee69446f7401c7f63f06629ee4b57967d1b0fba8935daf198b79
|
|
| MD5 |
2ba1ed0bb170ae5056e346950b206c4b
|
|
| BLAKE2b-256 |
999402d562badf8f05bf060f820faa88b14f1674ae10a4302d624bc25f5930b0
|
Provenance
The following attestation bundles were made for framewise_meet_client-0.1.6.tar.gz:
Publisher:
python-publish.yml on Framewise-AI/framewise_meet_client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
framewise_meet_client-0.1.6.tar.gz -
Subject digest:
31966ff7ee72ee69446f7401c7f63f06629ee4b57967d1b0fba8935daf198b79 - Sigstore transparency entry: 193705771
- Sigstore integration time:
-
Permalink:
Framewise-AI/framewise_meet_client@4c3a4e50c3a1386947589f61daced35432669532 -
Branch / Tag:
refs/tags/0.1.6 - Owner: https://github.com/Framewise-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4c3a4e50c3a1386947589f61daced35432669532 -
Trigger Event:
release
-
Statement type:
File details
Details for the file framewise_meet_client-0.1.6-py3-none-any.whl.
File metadata
- Download URL: framewise_meet_client-0.1.6-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77fda776c2bc73ed3bf6e7d73ab1fc18b6c264d4aea09eee7a9143508acdfadb
|
|
| MD5 |
d20ff89c9a472a89e3bee21aa6493262
|
|
| BLAKE2b-256 |
08b427bb9faaeeac964ed9cdc86f437db9ca6fcbbc618262feba13ddb61ed135
|
Provenance
The following attestation bundles were made for framewise_meet_client-0.1.6-py3-none-any.whl:
Publisher:
python-publish.yml on Framewise-AI/framewise_meet_client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
framewise_meet_client-0.1.6-py3-none-any.whl -
Subject digest:
77fda776c2bc73ed3bf6e7d73ab1fc18b6c264d4aea09eee7a9143508acdfadb - Sigstore transparency entry: 193705779
- Sigstore integration time:
-
Permalink:
Framewise-AI/framewise_meet_client@4c3a4e50c3a1386947589f61daced35432669532 -
Branch / Tag:
refs/tags/0.1.6 - Owner: https://github.com/Framewise-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4c3a4e50c3a1386947589f61daced35432669532 -
Trigger Event:
release
-
Statement type: