Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 committed Dec 11, 2024
1 parent e2761ba commit 5746d28
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,9 @@ export class Client implements LangSmithTracingClientInterface {

private async _getMultiPartSupport(): Promise<boolean> {
const serverInfo = await this._ensureServerInfo();
return serverInfo.instance_flags?.dataset_examples_multipart_enabled ?? false;
return (
serverInfo.instance_flags?.dataset_examples_multipart_enabled ?? false
);
}

private drainAutoBatchQueue(batchSizeLimit: number) {
Expand Down Expand Up @@ -2731,7 +2733,8 @@ export class Client implements LangSmithTracingClientInterface {
const { attachment_urls, ...rest } = rawExample;
const example: Example = rest;
if (attachment_urls) {
const attachmentsArray = Object.entries(attachment_urls).map(([key, value]) => {
const attachmentsArray = Object.entries(attachment_urls).map(
([key, value]) => {
async function* fetchReader() {
const response = await fetch(value.presigned_url);
yield* IterableReadableStream.fromReadableStream(response.body!);

Check warning on line 2740 in js/src/client.ts

View workflow job for this annotation

GitHub Actions / Check linting

Forbidden non-null assertion
Expand All @@ -2743,7 +2746,8 @@ export class Client implements LangSmithTracingClientInterface {
reader: IterableReadableStream.fromAsyncGenerator(fetchReader()),
},
};
});
}
);
// add attachments back to the example
example.attachments = attachmentsArray.reduce((acc, { key, value }) => {
if (value.reader != null) {
Expand Down Expand Up @@ -2839,7 +2843,8 @@ export class Client implements LangSmithTracingClientInterface {
const { attachment_urls, ...rest } = rawExample;
const example: Example = rest;
if (attachment_urls) {
const attachmentsArray = Object.entries(attachment_urls).map(([key, value]) => {
const attachmentsArray = Object.entries(attachment_urls).map(
([key, value]) => {
async function* fetchReader() {
const response = await fetch(value.presigned_url);
yield* IterableReadableStream.fromReadableStream(
Expand All @@ -2855,7 +2860,8 @@ export class Client implements LangSmithTracingClientInterface {
),
},
};
});
}
);
// add attachments back to the example
example.attachments = attachmentsArray.reduce(
(acc, { key, value }) => {
Expand Down

0 comments on commit 5746d28

Please sign in to comment.