Skip to content

Commit 009d4ff

Browse files
authored
Add tsc check to lint github action (#45)
1 parent 46b5a23 commit 009d4ff

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/lint-and-format.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,7 @@ jobs:
4444
run: pnpm format:check
4545

4646
- name: Run ESLint
47-
run: pnpm lint
47+
run: pnpm lint
48+
49+
- name: Run TypeScript check
50+
run: pnpm tsc

src/core/chorus/WebTools.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type SearchProviderConfig = {
2626
baseURL: string;
2727
apiKey: string;
2828
model: string;
29-
defaultHeaders?: Record<string, string>;
29+
defaultHeaders?: Record<string, string | null>;
3030
};
3131

3232
const OPENROUTER_PERPLEXITY_MODEL = "perplexity/sonar";
@@ -129,7 +129,13 @@ export class WebTools {
129129
const client = new OpenAI({
130130
baseURL: providerConfig.baseURL,
131131
apiKey: providerConfig.apiKey,
132-
defaultHeaders: providerConfig.defaultHeaders,
132+
defaultHeaders: providerConfig.defaultHeaders
133+
? Object.fromEntries(
134+
Object.entries(providerConfig.defaultHeaders).filter(
135+
([, value]) => value !== null,
136+
),
137+
)
138+
: undefined,
133139
dangerouslyAllowBrowser: true,
134140
});
135141

0 commit comments

Comments
 (0)