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

[Do not review] Testing TS Modular SDK generation #4

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MaryGao
Copy link

@MaryGao MaryGao commented Oct 8, 2023

[Do not review] Testing TS Modular SDK generation

fixes Azure/autorest.typescript#2042

...operationOptionsToRequestParameters(options),
contentType: (options.contentType as any) ?? "multipart/form-data",
body: {
file: uint8ArrayToString(audio["file"], "binary"),
Copy link
Author

Choose a reason for hiding this comment

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

[Compile Error]
src/api/operations.ts:148:49 - error TS2345: Argument of type '"binary"' is not assignable to parameter of type 'EncodingType'.

148 file: uint8ArrayToString(audio["file"], "binary")

object: result.body["object"],
created: new Date(result.body["created"]),
model: result.body["model"],
choices: (result.body["choices"] ?? []).map((p) => ({
Copy link
Author

Choose a reason for hiding this comment

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

[Compile Error]

src/api/operations.ts:278:5 - error TS2322: Type '{ index: any; message: { role: any; content: any; functionCall: { name: any; arguments: any; } | undefined; }; finishReason: any; }[]' is not assignable to type '[]'.
Target allows only 0 element(s) but source may have more.

278 choices: (result.body["choices"] ?? []).map((p) => ({

id: result.body["id"],
object: result.body["object"],
createdAt: new Date(result.body["created_at"]),
finishedAt: new Date(result.body["finished_at"]),
Copy link
Author

Choose a reason for hiding this comment

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

[Compile Error]

src/api/operations.ts:345:26 - error TS2769: No overload matches this call.
Overload 1 of 4, '(value: string | number | Date): Date', gave the following error.
Argument of type 'string | null' is not assignable to parameter of type 'string | number | Date'.
Type 'null' is not assignable to type 'string | number | Date'.
Overload 2 of 4, '(value: string | number): Date', gave the following error.
Argument of type 'string | null' is not assignable to parameter of type 'string | number'.
Type 'null' is not assignable to type 'string | number'.

345 finishedAt: new Date(result.body["finished_at"]),

validationFile: result.body["validation_file"],
resultFiles: result.body["result_files"],
trainedTokens: result.body["trained_tokens"],
error:
Copy link
Author

Choose a reason for hiding this comment

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

[Compile Error]

src/api/operations.ts:357:5 - error TS2322: Type '{ message: any; code: any; param: any; } | null' is not assignable to type 'null'.
Type '{ message: any; code: any; param: any; }' is not assignable to type 'null'.

357 error:


return {
object: result.body["object"],
data: (result.body["data"] ?? []).map((p) => ({
Copy link
Author

Choose a reason for hiding this comment

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

[Compile Error]

src/api/operations.ts:411:5 - error TS2322: Type '{ id: string; object: "fine_tuning.job"; createdAt: Date; finishedAt: Date; model: string; fineTunedModel: string | null; organizationId: string; status: any; hyperparameters: { ...; }; ... 4 more ...; error: { ...; } | null; }[]' is not assignable to type 'FineTuningJob[]'.
Type '{ id: string; object: "fine_tuning.job"; createdAt: Date; finishedAt: Date; model: string; fineTunedModel: string | null; organizationId: string; status: any; hyperparameters: { ...; }; ... 4 more ...; error: { ...; } | null; }' is not assignable to type 'FineTuningJob'.


export interface ListPaginatedFineTuningJobsResponse {
object: string;
data: FineTuningJob[];
Copy link
Author

Choose a reason for hiding this comment

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

[Compile Error]

src/models/models.ts:357:3
357 data: FineTuningJob[];
~~~~
The expected type comes from property 'data' which is declared here on type 'ListPaginatedFineTuningJobsResponse

*/
name?: string;
/** The name and arguments of a function that should be called, as generated by the model. */
functionCall?;
Copy link
Author

Choose a reason for hiding this comment

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

[Compile Error] anonymous model

annelo-msft referenced this pull request in annelo-msft/openai-in-typespec Mar 11, 2024
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.

Generate non-branded openai SDK
1 participant