Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/openai/types/responses/response_function_web_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ..._utils import PropertyInfo
from ..._models import BaseModel

__all__ = ["ResponseFunctionWebSearch", "Action", "ActionSearch", "ActionSearchSource", "ActionOpenPage", "ActionFind"]
__all__ = ["ResponseFunctionWebSearch", "Action", "ActionSearch", "ActionSearchSource", "ActionOpenPage", "ActionFind", "ActionFindInPage"]


class ActionSearchSource(BaseModel):
Expand All @@ -32,7 +32,7 @@ class ActionOpenPage(BaseModel):
type: Literal["open_page"]
"""The action type."""

url: str
url: Optional[str] = None
"""The URL opened by the model."""


Expand All @@ -47,7 +47,18 @@ class ActionFind(BaseModel):
"""The URL of the page searched for the pattern."""


Action: TypeAlias = Annotated[Union[ActionSearch, ActionOpenPage, ActionFind], PropertyInfo(discriminator="type")]
class ActionFindInPage(BaseModel):
pattern: str
"""The pattern or text to search for within the page."""

type: Literal["find_in_page"]
"""The action type."""

url: str
"""The URL of the page searched for the pattern."""


Action: TypeAlias = Annotated[Union[ActionSearch, ActionOpenPage, ActionFind, ActionFindInPage], PropertyInfo(discriminator="type")]


class ResponseFunctionWebSearch(BaseModel):
Expand Down