mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-23 15:18:14 +00:00
feat: add authentication field to PushNotificationConfig
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from a2a.types import PushNotificationAuthenticationInfo
|
||||||
from pydantic import AnyHttpUrl, BaseModel, Field
|
from pydantic import AnyHttpUrl, BaseModel, Field
|
||||||
|
|
||||||
from crewai.a2a.updates.base import PushNotificationResultStore
|
from crewai.a2a.updates.base import PushNotificationResultStore
|
||||||
@@ -14,6 +15,7 @@ class PushNotificationConfig(BaseModel):
|
|||||||
url: Callback URL where agent sends push notifications.
|
url: Callback URL where agent sends push notifications.
|
||||||
id: Unique identifier for this config.
|
id: Unique identifier for this config.
|
||||||
token: Token to validate incoming notifications.
|
token: Token to validate incoming notifications.
|
||||||
|
authentication: Auth info for agent to use when calling webhook.
|
||||||
timeout: Max seconds to wait for task completion.
|
timeout: Max seconds to wait for task completion.
|
||||||
interval: Seconds between result polling attempts.
|
interval: Seconds between result polling attempts.
|
||||||
result_store: Store for receiving push notification results.
|
result_store: Store for receiving push notification results.
|
||||||
@@ -22,6 +24,9 @@ class PushNotificationConfig(BaseModel):
|
|||||||
url: AnyHttpUrl = Field(description="Callback URL for push notifications")
|
url: AnyHttpUrl = Field(description="Callback URL for push notifications")
|
||||||
id: str | None = Field(default=None, description="Unique config identifier")
|
id: str | None = Field(default=None, description="Unique config identifier")
|
||||||
token: str | None = Field(default=None, description="Validation token")
|
token: str | None = Field(default=None, description="Validation token")
|
||||||
|
authentication: PushNotificationAuthenticationInfo | None = Field(
|
||||||
|
default=None, description="Auth info for agent to use when calling webhook"
|
||||||
|
)
|
||||||
timeout: float | None = Field(
|
timeout: float | None = Field(
|
||||||
default=300.0, gt=0, description="Max seconds to wait for task completion"
|
default=300.0, gt=0, description="Max seconds to wait for task completion"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ def _build_a2a_push_config(config: PushNotificationConfig) -> A2APushNotificatio
|
|||||||
url=str(config.url),
|
url=str(config.url),
|
||||||
id=config.id,
|
id=config.id,
|
||||||
token=config.token,
|
token=config.token,
|
||||||
|
authentication=config.authentication,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user