Skip to content

Commit

Permalink
Merge pull request #26 from airtop-ai/fix-module-exporting
Browse files Browse the repository at this point in the history
Fix main module exporting
  • Loading branch information
kvindascr authored Jan 30, 2025
2 parents 70614fd + 5e377cb commit 1f382c2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 138 deletions.
151 changes: 15 additions & 136 deletions src/airtop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,141 +1,20 @@
# This file was auto-generated by Fern from our API Definition.

from .types import (
AiPromptResponse,
AiResponseEnvelope,
ClientProvidedResponseMetadata,
CustomProxy,
OperationOutcome,
OperationOutcomeResponse,
VisualAnalysisConfig,
VisualAnalysisConfigPartitionDirection,
VisualAnalysisConfigScope,
EnvelopeDefaultMeta,
ErrorDetail,
ErrorMessage,
ErrorModel,
ExternalProfileV1,
ExternalSessionAiResponseMetadata,
ExternalSessionAiResponseMetadataStatus,
ExternalSessionAiResponseMetadataUsage,
ExternalSessionConfig,
ExternalSessionWithConnectionInfo,
Issue,
Pagination,
PageQueryExperimentalConfig,
ProfilesResponse,
Proxy,
ScrapeResponse,
ScrapeResponseContent,
ScrapeResponseEnvelope,
ScrapeResponseOutput,
SessionConfigV1,
SessionConfigV1Proxy,
SessionConfigV1ProxyItem,
SessionResponse,
SessionsResponse,
SessionsWithPagination,
StatusMessage,
StatusMessageStatus,
SummaryExperimentalConfig,
Window,
WindowId,
WindowIdResponse,
WindowResponse,
)
from .errors import InternalServerError, NotFoundError, UnprocessableEntityError
from .types import *
from .errors import *
from . import profiles, sessions, windows
from .client import Airtop, AsyncAirtop
from .environment import AirtopEnvironment
from .sessions import (
SessionsEventsResponse,
SessionsEventsResponseError,
SessionsEventsResponseStatus,
SessionsEventsResponse_Error,
SessionsEventsResponse_Status,
SessionsListRequestStatus,
)
from .client import *
from .environment import *
from .sessions import *
from .windows import *
from .core import *
from .core.api_error import *
from .utils import *
from .wrapper.sessions_client import *
from .wrapper.windows_client import *
from .version import __version__
from .windows import CreateWindowInputV1BodyWaitUntil, WindowLoadUrlV1BodyWaitUntil
from .wrapper.sessions_client import SessionConfig
from .wrapper.windows_client import SummaryConfig, PageQueryConfig
from .core import RequestOptions
from .core.api_error import ApiError
from .utils import BatchOperationUrl, BatchOperationInput, BatchOperationResponse, BatchOperationError, BatchOperateConfig


__all__ = [
"AiPromptResponse",
"AiResponseEnvelope",
"Airtop",
"AirtopEnvironment",
"AsyncAirtop",
"ApiError",
"ClientProvidedResponseMetadata",
"CreateWindowInputV1BodyWaitUntil",
"CustomProxy",
"EmptyResponse",
"EmptyResponseJson",
"EnvelopeDefaultMeta",
"EnvelopeStatusDefaultMeta",
"EnvelopeStatusDefaultMetaStatus",
"ErrorDetail",
"ErrorMessage",
"ErrorModel",
"ExternalProfileV1",
"ExternalSessionAiResponseMetadata",
"ExternalSessionAiResponseMetadataStatus",
"ExternalSessionAiResponseMetadataUsage",
"ExternalSessionConfig",
"ExternalSessionWithConnectionInfo",
"InternalServerError",
"Issue",
"NotFoundError",
"OperationOutcome",
"OperationOutcomeResponse",
'PageQueryConfig',
"PageQueryExperimentalConfig",
"Pagination",
"ProfilesResponse",
"Proxy",
"RequestOptions",
"ScrapeResponse",
"ScrapeResponseContent",
"ScrapeResponseEnvelope",
"ScrapeResponseOutput",
"SessionConfig",
"SessionConfigV1",
"SessionConfigV1Proxy",
"SessionConfigV1ProxyItem",
"SessionResponse",
"SessionsEventsResponse",
"SessionsEventsResponseError",
"SessionsEventsResponseStatus",
"SessionsEventsResponse_Error",
"SessionsEventsResponse_Status",
"SessionsListRequestStatus",
"SessionsResponse",
"SessionsWithPagination",
"StatusMessage",
"StatusMessageStatus",
"SummaryConfig",
"SummaryExperimentalConfig",
"UnprocessableEntityError",
"VisualAnalysisConfig",
"VisualAnalysisConfigPartitionDirection",
"VisualAnalysisConfigScope",
"Window",
"WindowId",
"WindowIdResponse",
"WindowLoadUrlV1BodyWaitUntil",
"WindowResponse",
"__version__",
"profiles",
"sessions",
"windows",
"BatchOperationUrl",
"BatchOperationInput",
"BatchOperationResponse",
"BatchOperationError",
"BatchOperateConfig",
]
# Exclude specific types from wildcard imports
__all__ = [name for name in dir() if not name.startswith('_') and name not in {
'SessionConfigV1',
}]
20 changes: 18 additions & 2 deletions src/airtop/wrapper/windows_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,13 @@ def type(
window_id: str,
*,
text: str,
clear_input_field: typing.Optional[bool] = OMIT,
client_request_id: typing.Optional[str] = OMIT,
configuration: typing.Optional[MicroInteractionConfig] = OMIT,
cost_threshold_credits: typing.Optional[int] = OMIT,
element_description: typing.Optional[str] = OMIT,
press_enter_key: typing.Optional[bool] = OMIT,
press_tab_key: typing.Optional[bool] = OMIT,
time_threshold_seconds: typing.Optional[int] = OMIT,
wait_for_navigation: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -503,6 +505,9 @@ def type(
text : str
The text to type into the browser window.
clear_input_field : typing.Optional[bool]
If true, and an HTML input field is active, clears the input field before typing the text.
client_request_id : typing.Optional[str]
configuration : typing.Optional[MicroInteractionConfig]
Expand All @@ -517,6 +522,9 @@ def type(
press_enter_key : typing.Optional[bool]
If true, simulates pressing the Enter key after typing the text.
press_tab_key : typing.Optional[bool]
If true, simulates pressing the Tab key after typing the text. Note that the tab key will be pressed after the Enter key if both options are configured.
time_threshold_seconds : typing.Optional[int]
A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
Expand Down Expand Up @@ -550,7 +558,7 @@ def type(
request_options = RequestOptions(timeout_in_seconds=600)
elif request_options.get("timeout_in_seconds") is None:
request_options.update({"timeout_in_seconds": 600})
return super().type(session_id, window_id, text=text, client_request_id=client_request_id, configuration=configuration, cost_threshold_credits=cost_threshold_credits, element_description=element_description, press_enter_key=press_enter_key, time_threshold_seconds=time_threshold_seconds, wait_for_navigation=wait_for_navigation, request_options=request_options)
return super().type(session_id, window_id, text=text, clear_input_field=clear_input_field, client_request_id=client_request_id, configuration=configuration, cost_threshold_credits=cost_threshold_credits, element_description=element_description, press_enter_key=press_enter_key, press_tab_key=press_tab_key, time_threshold_seconds=time_threshold_seconds, wait_for_navigation=wait_for_navigation, request_options=request_options)

def click(
self,
Expand Down Expand Up @@ -1247,11 +1255,13 @@ async def type(
window_id: str,
*,
text: str,
clear_input_field: typing.Optional[bool] = OMIT,
client_request_id: typing.Optional[str] = OMIT,
configuration: typing.Optional[MicroInteractionConfig] = OMIT,
cost_threshold_credits: typing.Optional[int] = OMIT,
element_description: typing.Optional[str] = OMIT,
press_enter_key: typing.Optional[bool] = OMIT,
press_tab_key: typing.Optional[bool] = OMIT,
time_threshold_seconds: typing.Optional[int] = OMIT,
wait_for_navigation: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -1268,6 +1278,9 @@ async def type(
text : str
The text to type into the browser window.
clear_input_field : typing.Optional[bool]
If true, and an HTML input field is active, clears the input field before typing the text.
client_request_id : typing.Optional[str]
configuration : typing.Optional[MicroInteractionConfig]
Expand All @@ -1282,6 +1295,9 @@ async def type(
press_enter_key : typing.Optional[bool]
If true, simulates pressing the Enter key after typing the text.
press_tab_key : typing.Optional[bool]
If true, simulates pressing the Tab key after typing the text. Note that the tab key will be pressed after the Enter key if both options are configured.
time_threshold_seconds : typing.Optional[int]
A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
Expand Down Expand Up @@ -1323,4 +1339,4 @@ async def main() -> None:
request_options = RequestOptions(timeout_in_seconds=600)
elif request_options.get("timeout_in_seconds") is None:
request_options.update({"timeout_in_seconds": 600})
return await super().type(session_id, window_id, text=text, client_request_id=client_request_id, configuration=configuration, cost_threshold_credits=cost_threshold_credits, element_description=element_description, press_enter_key=press_enter_key, time_threshold_seconds=time_threshold_seconds, wait_for_navigation=wait_for_navigation, request_options=request_options)
return await super().type(session_id, window_id, text=text, clear_input_field=clear_input_field, client_request_id=client_request_id, configuration=configuration, cost_threshold_credits=cost_threshold_credits, element_description=element_description, press_enter_key=press_enter_key, press_tab_key=press_tab_key, time_threshold_seconds=time_threshold_seconds, wait_for_navigation=wait_for_navigation, request_options=request_options)

0 comments on commit 1f382c2

Please sign in to comment.