Skip to content

Commit 91441c7

Browse files
committed
prettier
1 parent b0353b5 commit 91441c7

File tree

12 files changed

+242
-204
lines changed

12 files changed

+242
-204
lines changed

examples/agents-researcher/app/api/research/route.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ import { Redis } from '@upstash/redis';
55

66
import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run';
77
import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha';
8-
import { ExaSearchResults } from "@langchain/exa";
9-
import Exa from "exa-js";
8+
import { ExaSearchResults } from '@langchain/exa';
9+
import Exa from 'exa-js';
1010

1111
const client = new Exa(process.env.EXASEARCH_API_KEY);
1212

1313
//@ts-expect-error since we had to redeclare the workflowRunId
1414
class StepLogger extends WorkflowLogger {
1515
//@ts-expect-error since we had to redeclare the workflowRunId
1616
protected workflowRunId: string;
17+
1718
constructor() {
1819
super({ logLevel: 'SUBMIT', logOutput: 'console' });
1920
}
21+
2022
async log(
2123
level: LogLevel,
2224
eventType:
@@ -57,9 +59,7 @@ class StepLogger extends WorkflowLogger {
5759
})
5860
);
5961
}
60-
if (
61-
step.stepName === 'Run tool searchWeb'
62-
) {
62+
if (step.stepName === 'Run tool searchWeb') {
6363
await redis.rpush(
6464
`${this.workflowRunId}:searchOutput`,
6565
JSON.stringify({
@@ -131,9 +131,9 @@ export const { POST } = serve(
131131
client,
132132
searchArgs: {
133133
numResults: 3,
134-
type: "keyword",
135-
},
136-
}),
134+
type: 'keyword'
135+
}
136+
})
137137
}
138138
});
139139

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
"use client";
1+
'use client';
22

3-
import React, { useEffect } from "react";
4-
import Prism from "prismjs";
3+
import React, { useEffect } from 'react';
4+
import Prism from 'prismjs';
55

66
export default function CodeBlock({
77
children,
88
...props
9-
}: React.ComponentProps<"pre">) {
9+
}: React.ComponentProps<'pre'>) {
1010
const ref = React.useRef<HTMLPreElement>(null);
1111

1212
useEffect(() => {
@@ -19,9 +19,7 @@ export default function CodeBlock({
1919
className="!m-0 border-t border-t-zinc-800 !bg-transparent !p-4 !text-sm"
2020
{...props}
2121
>
22-
<code ref={ref}>
23-
{children}
24-
</code>
22+
<code ref={ref}>{children}</code>
2523
</pre>
2624
);
2725
}
Lines changed: 63 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,112 @@
11
/* eslint-disable @typescript-eslint/no-empty-object-type */
2-
import * as React from 'react'
3-
import cx from '../utils/cx'
4-
import type { StepStatus } from '../types'
5-
import { IconLoader } from '../icons/loader'
2+
import * as React from 'react';
3+
import cx from '../utils/cx';
4+
import type {StepStatus} from '../types';
5+
import {IconLoader} from '../icons/loader';
66

77
export interface StepProps extends React.ComponentPropsWithoutRef<'div'> {}
88

99
const Step = ({ className, ...props }: StepProps) => {
10-
return <div className={cx('[counter-reset:step]', className)} {...props} />
11-
}
12-
Step.displayName = 'Step'
10+
return <div className={cx('[counter-reset:step]', className)} {...props} />;
11+
};
12+
Step.displayName = 'Step';
1313

14-
export interface StepItemProps
15-
extends React.ComponentPropsWithoutRef<'span'> {
16-
status: StepStatus
14+
export interface StepItemProps extends React.ComponentPropsWithoutRef<'span'> {
15+
status: StepStatus;
1716
}
1817

1918
const StepItem = ({ status, className, ...props }: StepItemProps) => {
2019
return (
2120
<div
2221
className={cx(
2322
'relative border-l-2 border-l-zinc-200 pb-16 pl-6 last:pb-0 sm:ml-4 sm:pl-8 dark:border-l-zinc-900',
24-
(status === "init" ? 'border-l-zinc-200' : (status === "loading" ? 'border-l-purple-500' : 'border-l-emerald-500')),
25-
className,
23+
status === 'init'
24+
? 'border-l-zinc-200'
25+
: status === 'loading'
26+
? 'border-l-purple-500'
27+
: 'border-l-emerald-500',
28+
className
2629
)}
2730
{...props}
2831
/>
29-
)
30-
}
31-
StepItem.displayName = 'StepItem'
32+
);
33+
};
34+
StepItem.displayName = 'StepItem';
3235

3336
export interface StepNumberProps
3437
extends React.ComponentPropsWithoutRef<'span'> {
35-
order?: number
36-
status: StepStatus
38+
order?: number;
39+
status: StepStatus;
3740
}
3841

39-
const StepNumber = ({ order=1, status, className, ...props }: StepNumberProps) => {
42+
const StepNumber = ({
43+
order = 1,
44+
status,
45+
className,
46+
...props
47+
}: StepNumberProps) => {
4048
return (
4149
<span className="absolute top-0 left-0 h-6 sm:h-8">
42-
{status !== "loading" ? (
43-
<span
44-
className={cx(
45-
'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2',
46-
'flex size-8 items-center justify-center sm:size-10',
47-
'text-center rounded-full border-4 border-white',
48-
(status === "init" ? 'bg-zinc-100' : 'bg-emerald-500'),
49-
className,
50-
)}
51-
{...props}
52-
>
53-
<span className={cx("font-mono text-sm font-semibold", (status === "init" ? 'opacity-60' : 'text-white opacity-100'))}>{order}</span>
54-
</span>
55-
) : (
50+
{status !== 'loading' ? (
5651
<span
5752
className={cx(
5853
'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2',
5954
'flex size-8 items-center justify-center sm:size-10',
6055
'text-center rounded-full border-4 border-white',
56+
status === 'init' ? 'bg-zinc-100' : 'bg-emerald-500',
57+
className
58+
)}
59+
{...props}
60+
>
61+
<span
62+
className={cx(
63+
'font-mono text-sm font-semibold',
64+
status === 'init' ? 'opacity-60' : 'text-white opacity-100'
65+
)}
66+
>
67+
{order}
68+
</span>
69+
</span>
70+
) : (
71+
<span
72+
className={cx(
73+
'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2',
74+
'flex size-8 items-center justify-center sm:size-10',
75+
'text-center rounded-full border-4 border-white'
6176
)}
6277
>
63-
<span className='bg-white'>
78+
<span className="bg-white">
6479
<IconLoader className="animate-spin size-8 text-purple-500" />
6580
</span>
6681
</span>
6782
)}
6883
</span>
69-
)
70-
}
71-
StepNumber.displayName = 'StepNumber'
84+
);
85+
};
86+
StepNumber.displayName = 'StepNumber';
7287

7388
export interface StepTitleProps extends React.ComponentPropsWithoutRef<'h3'> {}
7489

7590
const StepTitle = ({ className, ...props }: StepTitleProps) => {
76-
return <h3 className={cx('font-semibold sm:text-lg', className)} {...props} />
77-
}
78-
StepTitle.displayName = 'StepTitle'
91+
return (
92+
<h3 className={cx('font-semibold sm:text-lg', className)} {...props} />
93+
);
94+
};
95+
StepTitle.displayName = 'StepTitle';
7996

8097
export interface StepDescProps extends React.ComponentPropsWithoutRef<'h3'> {}
8198

8299
const StepDesc = ({ className, ...props }: StepDescProps) => {
83-
return <div className={cx('opacity-60', className)} {...props} />
84-
}
85-
StepDesc.displayName = 'StepDesc'
100+
return <div className={cx('opacity-60', className)} {...props} />;
101+
};
102+
StepDesc.displayName = 'StepDesc';
86103

87104
export interface StepContentProps
88105
extends React.ComponentPropsWithoutRef<'div'> {}
89106

90107
const StepContent = ({ className, ...props }: StepContentProps) => {
91-
return <div className={cx('mt-6', className)} {...props} />
92-
}
93-
StepContent.displayName = 'StepContent'
108+
return <div className={cx('mt-6', className)} {...props} />;
109+
};
110+
StepContent.displayName = 'StepContent';
94111

95-
export { Step, StepItem, StepNumber, StepTitle, StepDesc, StepContent }
112+
export { Step, StepItem, StepNumber, StepTitle, StepDesc, StepContent };

examples/agents-researcher/app/constants/codes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const CODES = {
5050
}),
5151
}
5252
});`,
53-
"Cross Reference": `const crossReferenceTask = context.agents.task({
53+
'Cross Reference': `const crossReferenceTask = context.agents.task({
5454
model,
5555
prompt:
5656
"You are an agent that takes input from other agents with access to different " +
@@ -62,5 +62,5 @@ export const CODES = {
6262
});
6363
6464
const { text } = await crossReferenceTask.run();
65-
`,
65+
`
6666
};

examples/agents-researcher/app/icons/caret-dropdown.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from "react";
1+
import React from 'react';
22

33
export const IconCaretDownFilled = ({
4-
className,
4+
className
55
}: {
6-
className?: React.HTMLProps<HTMLElement>["className"];
6+
className?: React.HTMLProps<HTMLElement>['className'];
77
}) => {
88
return (
99
<svg

examples/agents-researcher/app/icons/workflow-icon.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const DEFAULT_ICON_SIZE = 32
1+
const DEFAULT_ICON_SIZE = 32;
22

33
export const WorkflowIcon = ({ size = DEFAULT_ICON_SIZE }) => {
44
return (
@@ -18,5 +18,5 @@ export const WorkflowIcon = ({ size = DEFAULT_ICON_SIZE }) => {
1818
strokeLinejoin="round"
1919
/>
2020
</svg>
21-
)
22-
}
21+
);
22+
};
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
import type { Metadata } from 'next'
2-
import { Inter } from 'next/font/google'
3-
import './globals.css'
4-
import cx from './utils/cx'
5-
import 'prismjs/themes/prism-tomorrow.css'
1+
import type { Metadata } from 'next';
2+
import { Inter } from 'next/font/google';
3+
import './globals.css';
4+
import cx from './utils/cx';
5+
import 'prismjs/themes/prism-tomorrow.css';
66

77
export const metadata: Metadata = {
88
title: 'Cross Referencer',
99
description: 'Generated by create next app',
1010
icons: {
11-
icon: '/favicon-32x32.png',
12-
},
13-
}
11+
icon: '/favicon-32x32.png'
12+
}
13+
};
1414

1515
const defaultFont = Inter({
1616
variable: '--font-inter',
1717
display: 'swap',
1818
style: 'normal',
19-
subsets: ['latin-ext'],
20-
})
19+
subsets: ['latin-ext']
20+
});
2121

2222
export default function RootLayout({
23-
children,
23+
children
2424
}: Readonly<{
25-
children: React.ReactNode
25+
children: React.ReactNode;
2626
}>) {
2727
return (
2828
<html lang="en" className={cx('scroll-smooth', defaultFont.variable)}>
2929
<body className="antialiased text-sm sm:text-base">{children}</body>
3030
</html>
31-
)
31+
);
3232
}

0 commit comments

Comments
 (0)