Skip to content

Add Workers Ai types - #2033

Merged
penalosa merged 2 commits into
cloudflare:mainfrom
G4brym:add-ai-binding-types
Apr 25, 2024
Merged

Add Workers Ai types#2033
penalosa merged 2 commits into
cloudflare:mainfrom
G4brym:add-ai-binding-types

Conversation

@G4brym

@G4brym G4brym commented Apr 18, 2024

Copy link
Copy Markdown
Member

No description provided.

@G4brym
G4brym marked this pull request as ready for review April 18, 2024 10:46
@G4brym
G4brym requested review from a team as code owners April 18, 2024 10:46
Comment thread types/defines/ai.d.ts Outdated
@G4brym
G4brym force-pushed the add-ai-binding-types branch 3 times, most recently from 67c9f6e to 047dee7 Compare April 19, 2024 16:53
Comment thread types/defines/ai.d.ts Outdated
Comment thread types/defines/ai.d.ts Outdated
@G4brym
G4brym force-pushed the add-ai-binding-types branch 5 times, most recently from 3435b7e to 445d72e Compare April 23, 2024 09:05
Comment thread types/defines/ai.d.ts Outdated
declare abstract class Ai {
private readonly fetcher;
private options;
lastRequestId: string | null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this property intentionally public? I can't find it in the docs

@penalosa penalosa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple comments, and it still looks like there are some none abstract classes—are those intended to be user constructable?

Comment thread types/defines/ai.d.ts Outdated
Comment on lines +279 to +280
private readonly fetcher;
private options;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This are internal implementation details that shouldn't be included

Comment thread types/defines/ai.d.ts Outdated
private readonly fetcher;
private options;
lastRequestId: string | null;
constructor(fetcher: Fetcher);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't user constructable, so the constructor shouldn't be included

@G4brym
G4brym force-pushed the add-ai-binding-types branch from 445d72e to d7e56df Compare April 24, 2024 11:02
@G4brym
G4brym force-pushed the add-ai-binding-types branch from d7e56df to 7f3789c Compare April 24, 2024 16:13
@penalosa
penalosa merged commit 925a1cb into cloudflare:main Apr 25, 2024
garrettgu10 pushed a commit that referenced this pull request May 13, 2024
* Add Workers Ai types

* Improve ai types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants