Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vertex GA] Regenerate docs after Vertex GA changes #8505

Open
wants to merge 21 commits into
base: ch-docs-rename-base
Choose a base branch
from

Conversation

hsubox76
Copy link
Contributor

@hsubox76 hsubox76 commented Sep 17, 2024

Regenerated docs based on all code changes for Vertex GA so far.

Changes are:

  • added Schema classes
  • remove "unspecified" enum values
  • change optionality on some properties

@hsubox76 hsubox76 marked this pull request as ready for review September 17, 2024 18:24
@hsubox76 hsubox76 requested a review from a team as a code owner September 17, 2024 18:24
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 17, 2024

Size Report 1

Affected Products

  • @firebase/vertexai

    TypeBase (45e0afe)Merge (fa7f743)Diff
    browser28.3 kB28.4 kB+25 B (+0.1%)
    main29.2 kB29.2 kB+25 B (+0.1%)
    module28.3 kB28.4 kB+25 B (+0.1%)
  • firebase

    TypeBase (45e0afe)Merge (fa7f743)Diff
    firebase-vertexai.js21.9 kB22.0 kB+42 B (+0.2%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/lXkjBGDKfQ.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 17, 2024

Size Analysis Report 1

Affected Products

  • @firebase/vertexai

    • ChatSession

      Size

      TypeBase (45e0afe)Merge (fa7f743)Diff
      size14.4 kB14.4 kB+27 B (+0.2%)
      size-with-ext-deps32.9 kB32.9 kB+27 B (+0.1%)
    • GenerativeModel

      Size

      TypeBase (45e0afe)Merge (fa7f743)Diff
      size16.9 kB16.9 kB+27 B (+0.2%)
      size-with-ext-deps35.4 kB35.4 kB+27 B (+0.1%)
    • getGenerativeModel

      Size

      TypeBase (45e0afe)Merge (fa7f743)Diff
      size17.1 kB17.1 kB+27 B (+0.2%)
      size-with-ext-deps35.6 kB35.6 kB+27 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/0oUZK6ZrVv.html

docs-devsite/vertexai-preview.generationconfig.md Outdated Show resolved Hide resolved
docs-devsite/vertexai-preview.generationconfig.md Outdated Show resolved Hide resolved
docs-devsite/vertexai-preview.md Outdated Show resolved Hide resolved
| [IntegerSchema](./vertexai-preview.integerschema.md#integerschema_class) | Schema class for "integer" types. |
| [NumberSchema](./vertexai-preview.numberschema.md#numberschema_class) | Schema class for "number" types. |
| [ObjectSchema](./vertexai-preview.objectschema.md#objectschema_class) | Schema class for "object" types. The <code>properties</code> param must be a map of Schema. |
| [Schema](./vertexai-preview.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex REST endpoints. (This string conversion is automatically done when calling SDK methods.) |
Copy link
Contributor

Choose a reason for hiding this comment

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

Vertex -> Vertex AI

(comment applies to several other instances, even in other files)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't seem to find the corresponding new file in the new set of files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the missing files should be back now.

| [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | |
| [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. |
| [HarmCategory](./vertexai-preview.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. |
| [HarmProbability](./vertexai-preview.md#harmprobability) | Probability that a prompt or candidate matches a harm category. |
| [HarmSeverity](./vertexai-preview.md#harmseverity) | Harm severity levels. |
| [SchemaType](./vertexai-preview.md#schematype) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ |
Copy link
Contributor

Choose a reason for hiding this comment

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

NOT BLOCKING

Usually, we try to make all URLs into hyperlinks rather than having the actual URL exposed.

(comment applies to several other instances, even in other files)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't seem to find the corresponding new file in the new set of files?

| [SchemaInterface](./vertexai-preview.schemainterface.md#schemainterface_interface) | Interface for Schema class. |
| [SchemaParams](./vertexai-preview.schemaparams.md#schemaparams_interface) | User-facing params passed to specific Schema static methods. |
| [SchemaRequest](./vertexai-preview.schemarequest.md#schemarequest_interface) | Final format for Schema params passed to backend requests. |
| [SchemaShared](./vertexai-preview.schemashared.md#schemashared_interface) | Basic <code>Schema</code> properties shared across several Schema-related types. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is Schema tagged as code here, but not anywhere else?

FWIW - I would prolly recommend tagging it almost everywhere as code. And ObjectSchema and StringSchema, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can actually make them links, so did so.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't seem to find the corresponding new file in the new set of files?

docs-devsite/vertexai-preview.schema.md Outdated Show resolved Hide resolved
| [number(numberParams)](./vertexai-preview.schema.md#schemanumber) | <code>static</code> | |
| [object(objectParams)](./vertexai-preview.schema.md#schemaobject) | <code>static</code> | |
| [string(stringParams)](./vertexai-preview.schema.md#schemastring) | <code>static</code> | |
| [toJSON()](./vertexai-preview.schema.md#schematojson) | | Defines how this Schema should be serialized as JSON. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/JSON/stringify\#tojson\_behavior |
Copy link
Contributor

Choose a reason for hiding this comment

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

another exposed URL that should be a hyperlink

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Was it intentional to remove toJSON() here? Maybe I'm missing it, but it doesn't seem to be in the newly generated file?

docs-devsite/vertexai.schema.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it doesn't need to be publicly exposed, it's for internal use.

docs-devsite/vertexai-preview.schemaparams.md Outdated Show resolved Hide resolved
@hsubox76 hsubox76 requested a review from a team as a code owner September 19, 2024 16:56
Copy link

changeset-bot bot commented Sep 19, 2024

⚠️ No Changeset found

Latest commit: 9af2001

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor Author

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

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

Addressed comments. Some of the changes have added some source files to this PR, that are the source of the changes. You don't have to review them, you can just look at the markdown files.

Copy link
Contributor

@DellaBitta DellaBitta left a comment

Choose a reason for hiding this comment

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

Is it a problem that docs-devsite/_toc.yaml was removed?

@hsubox76 hsubox76 force-pushed the ch-schema-docs branch 2 times, most recently from e6195cd to 145e5d8 Compare September 23, 2024 17:30
@hsubox76 hsubox76 changed the title Generate Schema docs [Vertex GA] Generate Schema docs Sep 23, 2024
@hsubox76 hsubox76 added this to the Vertex GA milestone Sep 23, 2024
@hsubox76 hsubox76 changed the base branch from ch-schema to v11 September 24, 2024 17:25
@hsubox76 hsubox76 changed the base branch from v11 to ch-docs-rename-base September 25, 2024 16:17
@hsubox76 hsubox76 changed the title [Vertex GA] Generate Schema docs [Vertex GA] Regenerate docs after Vertex GA changes Sep 25, 2024

<b>Signature:</b>

```typescript
responseMimeType?: string;
```

## GenerationConfig.responseSchema

Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai-preview.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai-preview.schemarequest.md#schemarequest_interface) interface. <br/>Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json`<!-- -->.
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't responseSchema also support the MIME type of text/x.enum?

https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output#considerations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess so. Added. I don't really know anything about it other than what's in that page so I just put the type in there and didn't add any explanation. I originally pulled this comment off the proto. https://source.corp.google.com/piper///depot/google3/google/cloud/aiplatform/master/content.proto;l=269?q=generationconfig&ss=piper%2FGoogle%2FPiper:google3%2Fgoogle%2Fcloud%2Faiplatform%2Fmaster%2F

I'm not sure what I'm supposed to use for the source of truth.


<b>Signature:</b>

```typescript
responseMimeType?: string;
```

## GenerationConfig.responseSchema

Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai-preview.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai-preview.schemarequest.md#schemarequest_interface) interface. <br/>Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json`<!-- -->.
Copy link
Contributor

Choose a reason for hiding this comment

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

NOT BLOCKING

Schema and SchemaRequest

Both should be tagged as code in the source code. Pls look throughout the source code for other instances.

Anytime that you're referring to a specific component (method / field / enum / etc. name, file names, input / output value, etc.), then tag it as code.

One very generalized way to think about it to decide if something should be tagged as code: "Would I want this translated into German, Korean, etc.?" Note that our ref docs aren't translated, but this way of thinking helps you decide about appropriate tagging :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming by "tag as code" you mean to make it so it ends up in the markdown within <code> tags? This was pretty tricky, we normally do it with backticks but you can't do it on links so you normally choose between either having a link or having code tags. I think I found a way to do it although it's a little fragile. I did a search/replace on all @links in the package.

| [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | |
| [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. |
| [HarmCategory](./vertexai-preview.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. |
| [HarmProbability](./vertexai-preview.md#harmprobability) | Probability that a prompt or candidate matches a harm category. |
| [HarmSeverity](./vertexai-preview.md#harmseverity) | Harm severity levels. |
| [SchemaType](./vertexai-preview.md#schematype) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ |
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't seem to find the corresponding new file in the new set of files?

| [SchemaInterface](./vertexai-preview.schemainterface.md#schemainterface_interface) | Interface for Schema class. |
| [SchemaParams](./vertexai-preview.schemaparams.md#schemaparams_interface) | User-facing params passed to specific Schema static methods. |
| [SchemaRequest](./vertexai-preview.schemarequest.md#schemarequest_interface) | Final format for Schema params passed to backend requests. |
| [SchemaShared](./vertexai-preview.schemashared.md#schemashared_interface) | Basic <code>Schema</code> properties shared across several Schema-related types. |
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't seem to find the corresponding new file in the new set of files?

| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. |
| [items](./vertexai.schemashared.md#schemashareditems) | T | Optional. The items of the property. |
| [nullable](./vertexai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. |
| [properties](./vertexai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schemas. |
Copy link
Contributor

Choose a reason for hiding this comment

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

NOT BLOCKING

This should probably be this?

Map of Schema objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

| [IntegerSchema](./vertexai-preview.integerschema.md#integerschema_class) | Schema class for "integer" types. |
| [NumberSchema](./vertexai-preview.numberschema.md#numberschema_class) | Schema class for "number" types. |
| [ObjectSchema](./vertexai-preview.objectschema.md#objectschema_class) | Schema class for "object" types. The <code>properties</code> param must be a map of Schema. |
| [Schema](./vertexai-preview.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex REST endpoints. (This string conversion is automatically done when calling SDK methods.) |
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't seem to find the corresponding new file in the new set of files?

| [number(numberParams)](./vertexai-preview.schema.md#schemanumber) | <code>static</code> | |
| [object(objectParams)](./vertexai-preview.schema.md#schemaobject) | <code>static</code> | |
| [string(stringParams)](./vertexai-preview.schema.md#schemastring) | <code>static</code> | |
| [toJSON()](./vertexai-preview.schema.md#schematojson) | | Defines how this Schema should be serialized as JSON. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/JSON/stringify\#tojson\_behavior |
Copy link
Contributor

Choose a reason for hiding this comment

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

Was it intentional to remove toJSON() here? Maybe I'm missing it, but it doesn't seem to be in the newly generated file?

docs-devsite/vertexai.schema.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants