Skip to content

Commit

Permalink
Merge pull request #24 from airtop-ai/fern-bot/11-07-2024-1209AM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- November 7, 2024 - Kib
  • Loading branch information
kvindascr authored Nov 7, 2024
2 parents 432f171 + 9c82018 commit 61a4433
Show file tree
Hide file tree
Showing 19 changed files with 362 additions and 233 deletions.
34 changes: 32 additions & 2 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ await client.sessions.create();
</dl>
</details>

<details><summary><code>client.sessions.<a href="/src/api/resources/sessions/client/Client.ts">getinfo</a>(id) -> Airtop.SessionResponse</code></summary>
<details><summary><code>client.sessions.<a href="/src/api/resources/sessions/client/Client.ts">getInfo</a>(id) -> Airtop.SessionResponse</code></summary>
<dl>
<dd>

Expand Down Expand Up @@ -272,7 +272,7 @@ Get a session by ID
<dd>

```typescript
await client.sessions.getinfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b");
await client.sessions.getInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b");
```

</dd>
Expand Down Expand Up @@ -749,6 +749,21 @@ await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

This endpoint is deprecated. Please use the `pageQuery` endpoint instead.

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand Down Expand Up @@ -879,6 +894,21 @@ await client.windows.scrapeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/sessions/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ export class Sessions {
* @throws {@link Airtop.InternalServerError}
*
* @example
* await client.sessions.getinfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
* await client.sessions.getInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
*/
public async getinfo(id: string, requestOptions?: Sessions.RequestOptions): Promise<Airtop.SessionResponse> {
public async getInfo(id: string, requestOptions?: Sessions.RequestOptions): Promise<Airtop.SessionResponse> {
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.AirtopEnvironment.Default,
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/sessions/types/SessionsEventsResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import * as Airtop from "../../../index";
/**
* Each oneOf object in the array represents one possible Server Sent Events (SSE) message, serialized as UTF-8 text according to the SSE specification.
*/
export type SessionsEventsResponse = Airtop.SessionsEventsResponse.Error_ | Airtop.SessionsEventsResponse.Status;
export type SessionsEventsResponse = Airtop.SessionsEventsResponse.Status | Airtop.SessionsEventsResponse.Error_;

export declare namespace SessionsEventsResponse {
interface Error_ extends Airtop.SessionsEventsResponseError {
event: "error";
}

interface Status extends Airtop.SessionsEventsResponseStatus {
event: "status";
}

interface Error_ extends Airtop.SessionsEventsResponseError {
event: "error";
}
}
2 changes: 1 addition & 1 deletion src/api/resources/sessions/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./SessionsListRequestStatus";
export * from "./SessionsEventsResponseError";
export * from "./SessionsEventsResponseStatus";
export * from "./SessionsEventsResponseError";
export * from "./SessionsEventsResponse";
4 changes: 4 additions & 0 deletions src/api/resources/windows/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ export class Windows {
}

/**
* This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
*
* @param {string} sessionId - The session id for the window.
* @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
Expand Down Expand Up @@ -534,6 +536,8 @@ export class Windows {
}

/**
* This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
*
* @param {string} sessionId - The session id for the window.
* @param {string} windowId - The Airtop window id of the browser window to summarize.
* @param {Airtop.SessionSummaryHandlerRequestBody} request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Airtop from "../../../../index";

/**
* @example
* {}
*/
export interface SessionSummaryHandlerRequestBody {
clientRequestId?: string;
/** Request configuration */
configuration?: Airtop.SummaryConfig;
/** A credit threshold 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). */
costThresholdCredits?: number;
/** An optional prompt providing the Airtop AI model with additional direction or constraints about the summary (such as desired length). */
Expand Down
6 changes: 2 additions & 4 deletions src/api/types/PageQueryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Airtop from "../index";

export interface PageQueryConfig {
/** Experimental configuration options. These may be subject to change and are not guaranteed to be stable across versions. */
experimental?: Airtop.PageQueryExperimentalConfig;
/** JSON schema defining the structure of the output. If not provided, the format of the output might vary. */
outputSchema?: string;
}
4 changes: 4 additions & 0 deletions src/api/types/SessionPageQueryHandlerRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Airtop from "../index";

export interface SessionPageQueryHandlerRequestBody {
clientRequestId?: string;
/** Request configuration */
configuration?: Airtop.PageQueryConfig;
/** A credit threshold 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). */
costThresholdCredits?: number;
/** Make a best effort attempt to load more content items than are originally displayed on the page, e.g. by following pagination links, clicking controls to load more content, utilizing infinite scrolling, etc. This can be quite a bit more costly, but may be necessary for sites that require additional interaction to show the needed results. You can provide constraints in your prompt (e.g. on the total number of pages or results to consider). */
Expand Down
5 changes: 2 additions & 3 deletions src/api/types/SummaryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Airtop from "../index";

export interface SummaryConfig {
experimental?: Airtop.SummaryExperimentalConfig;
/** JSON schema defining the structure of the output. If not provided, the format of the output might vary. */
outputSchema?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
import * as serializers from "../../../index";
import * as Airtop from "../../../../api/index";
import * as core from "../../../../core";
import { SessionsEventsResponseError } from "./SessionsEventsResponseError";
import { SessionsEventsResponseStatus } from "./SessionsEventsResponseStatus";
import { SessionsEventsResponseError } from "./SessionsEventsResponseError";

export const SessionsEventsResponse: core.serialization.Schema<
serializers.SessionsEventsResponse.Raw,
Airtop.SessionsEventsResponse
> = core.serialization
.union("event", {
error: SessionsEventsResponseError,
status: SessionsEventsResponseStatus,
error: SessionsEventsResponseError,
})
.transform<Airtop.SessionsEventsResponse>({
transform: (value) => value,
untransform: (value) => value,
});

export declare namespace SessionsEventsResponse {
type Raw = SessionsEventsResponse.Error | SessionsEventsResponse.Status;

interface Error extends SessionsEventsResponseError.Raw {
event: "error";
}
type Raw = SessionsEventsResponse.Status | SessionsEventsResponse.Error;

interface Status extends SessionsEventsResponseStatus.Raw {
event: "status";
}

interface Error extends SessionsEventsResponseError.Raw {
event: "error";
}
}
2 changes: 1 addition & 1 deletion src/serialization/resources/sessions/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./SessionsListRequestStatus";
export * from "./SessionsEventsResponseError";
export * from "./SessionsEventsResponseStatus";
export * from "./SessionsEventsResponseError";
export * from "./SessionsEventsResponse";
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import * as serializers from "../../../../index";
import * as Airtop from "../../../../../api/index";
import * as core from "../../../../../core";
import { SummaryConfig } from "../../../../types/SummaryConfig";

export const SessionSummaryHandlerRequestBody: core.serialization.Schema<
serializers.SessionSummaryHandlerRequestBody.Raw,
Airtop.SessionSummaryHandlerRequestBody
> = core.serialization.object({
clientRequestId: core.serialization.string().optional(),
configuration: SummaryConfig.optional(),
costThresholdCredits: core.serialization.number().optional(),
prompt: core.serialization.string().optional(),
timeThresholdSeconds: core.serialization.number().optional(),
Expand All @@ -19,6 +21,7 @@ export const SessionSummaryHandlerRequestBody: core.serialization.Schema<
export declare namespace SessionSummaryHandlerRequestBody {
interface Raw {
clientRequestId?: string | null;
configuration?: SummaryConfig.Raw | null;
costThresholdCredits?: number | null;
prompt?: string | null;
timeThresholdSeconds?: number | null;
Expand Down
5 changes: 2 additions & 3 deletions src/serialization/types/PageQueryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
import * as serializers from "../index";
import * as Airtop from "../../api/index";
import * as core from "../../core";
import { PageQueryExperimentalConfig } from "./PageQueryExperimentalConfig";

export const PageQueryConfig: core.serialization.ObjectSchema<serializers.PageQueryConfig.Raw, Airtop.PageQueryConfig> =
core.serialization.object({
experimental: PageQueryExperimentalConfig.optional(),
outputSchema: core.serialization.string().optional(),
});

export declare namespace PageQueryConfig {
interface Raw {
experimental?: PageQueryExperimentalConfig.Raw | null;
outputSchema?: string | null;
}
}
3 changes: 3 additions & 0 deletions src/serialization/types/SessionPageQueryHandlerRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import * as serializers from "../index";
import * as Airtop from "../../api/index";
import * as core from "../../core";
import { PageQueryConfig } from "./PageQueryConfig";

export const SessionPageQueryHandlerRequestBody: core.serialization.ObjectSchema<
serializers.SessionPageQueryHandlerRequestBody.Raw,
Airtop.SessionPageQueryHandlerRequestBody
> = core.serialization.object({
clientRequestId: core.serialization.string().optional(),
configuration: PageQueryConfig.optional(),
costThresholdCredits: core.serialization.number().optional(),
followPaginationLinks: core.serialization.boolean().optional(),
prompt: core.serialization.string(),
Expand All @@ -20,6 +22,7 @@ export const SessionPageQueryHandlerRequestBody: core.serialization.ObjectSchema
export declare namespace SessionPageQueryHandlerRequestBody {
interface Raw {
clientRequestId?: string | null;
configuration?: PageQueryConfig.Raw | null;
costThresholdCredits?: number | null;
followPaginationLinks?: boolean | null;
prompt: string;
Expand Down
5 changes: 2 additions & 3 deletions src/serialization/types/SummaryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
import * as serializers from "../index";
import * as Airtop from "../../api/index";
import * as core from "../../core";
import { SummaryExperimentalConfig } from "./SummaryExperimentalConfig";

export const SummaryConfig: core.serialization.ObjectSchema<serializers.SummaryConfig.Raw, Airtop.SummaryConfig> =
core.serialization.object({
experimental: SummaryExperimentalConfig.optional(),
outputSchema: core.serialization.string().optional(),
});

export declare namespace SummaryConfig {
interface Raw {
experimental?: SummaryExperimentalConfig.Raw | null;
outputSchema?: string | null;
}
}
24 changes: 11 additions & 13 deletions src/wrapper/AirtopClient.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
import { AirtopClient as FernClient } from '../Client'; // alias the Fern generated client
import { AirtopWindows } from './AirtopWindows';
import { AirtopSessions } from './AirtopSessions';
import { AirtopWindows } from './AirtopWindows';

type AugmentedOptions = FernClient.Options & { debug?: boolean };

export class AirtopClient {
public debug: boolean;
private _client: FernClient;
private _windowsWrapper: AirtopWindows;
private _sessionsWrapper: AirtopSessions;

constructor(options: AugmentedOptions) {
this._client = new FernClient(options);
this.debug = options?.debug || false;
this._windowsWrapper = new AirtopWindows(this._client, options?.apiKey);
this._sessionsWrapper = new AirtopSessions(this._client, options?.debug);
private _windows: AirtopWindows | undefined;
private _sessions: AirtopSessions | undefined;

constructor(private _options: AugmentedOptions) {
this._client = new FernClient(_options);
this.debug = _options?.debug || false;
}

get windows() {
return this._windowsWrapper;
public get sessions(): AirtopSessions {
return (this._sessions ??= new AirtopSessions(this._options, this.debug));
}

get sessions() {
return this._sessionsWrapper;
public get windows(): AirtopWindows {
return (this._windows ??= new AirtopWindows(this._options, this._options.apiKey));
}

get profiles() {
Expand Down
Loading

0 comments on commit 61a4433

Please sign in to comment.