
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Python SDK for Antonnia Events and Webhooks
The antonnia-events
package provides type-safe event definitions for Antonnia webhook events. It's part of the Antonnia Python SDK ecosystem and works seamlessly with other Antonnia packages.
pip install antonnia-events
Note: This package has a dependency on antonnia-conversations
for the underlying data types.
from antonnia.events import Event, MessageCreated, SessionCreated
# Parse webhook events
def handle_webhook(event_data: dict):
event = Event.model_validate(event_data)
if isinstance(event, MessageCreated):
print(f"New message: {event.data.object.id}")
elif isinstance(event, SessionCreated):
print(f"New session: {event.data.object.id}")
MessageCreated
- Fired when a new message is createdSessionCreated
- Fired when a new session is createdSessionFinished
- Fired when a session is finishedSessionTransferred
- Fired when a session is transferredAll events inherit from EventBase
and have this structure:
{
"id": "event_123",
"created_at": "2023-12-01T12:00:00Z",
"type": "message.created",
"data": {
"object": {
# The actual Message or Session object
}
}
}
from fastapi import FastAPI
from antonnia.events import Event
app = FastAPI()
@app.post("/webhook")
async def handle_webhook(event: Event):
# Event is automatically validated and parsed
return {"status": "received"}
from flask import Flask, request
from antonnia.events import Event
app = Flask(__name__)
@app.route("/webhook", methods=["POST"])
def handle_webhook():
event = Event.model_validate(request.json)
# Handle the event
return {"status": "received"}
The package provides full type safety with discriminated unions:
from antonnia.events import Event, MessageCreated
def process_event(event: Event):
# Type checker knows the event type based on isinstance check
if isinstance(event, MessageCreated):
# event.data.object is typed as Message
message = event.data.object
print(f"Message content: {message.content}")
pip install -e .[dev]
pytest
black .
isort .
mypy .
MIT License - see LICENSE file for details.
antonnia-conversations
- Conversations API clientFor support, please visit https://antonnia.com/support or create an issue in our GitHub repository.
FAQs
Python SDK for Antonnia Events and Webhooks
We found that antonnia-events 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.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.