• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gregreindel / llm-exe-lambda / 13487908470

23 Feb 2025 11:17PM UTC coverage: 96.189% (-1.0%) from 97.222%
13487908470

push

github

gregreindel
xAI support, change function name to not include version

156 of 168 branches covered (92.86%)

Branch coverage included in aggregate %.

12 of 15 new or added lines in 1 file covered. (80.0%)

1 existing line in 1 file now uncovered.

374 of 383 relevant lines covered (97.65%)

5.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/source/utils/getKeyObjectFromProvider.ts
1
import { withKey } from "@/clients/keychain";
4✔
2
import { useLlm } from "llm-exe";
3

4
export async function getKeyObjectFromProvider(
4✔
5
  provider: Parameters<typeof useLlm>[0]
6
) {
7
  if (provider.startsWith("openai")) {
5✔
8
    const openAiApiKey = await withKey("KeyOpenAI");
2✔
9
    if (!openAiApiKey) {
2✔
10
      throw new Error("OpenAI API Key not found");
1✔
11
    }
12
    return { openAiApiKey };
1✔
13
  }
14

15
  if (provider.startsWith("anthropic")) {
3✔
16
    const anthropicApiKey = await withKey("KeyAnthropic");
2✔
17
    if (!anthropicApiKey) {
2✔
18
      throw new Error("Anthropic API Key not found");
1✔
19
    }
20
    return { anthropicApiKey };
1✔
21
  }
22

23
  if (provider.startsWith("xai")) {
1!
NEW
24
    const xAiApiKey = await withKey("KeyXAI");
×
NEW
25
    if (!xAiApiKey) {
×
NEW
26
      throw new Error("xAI API Key not found");
×
27
    }
UNCOV
28
    return { xAiApiKey };
×
29
  }
30

31
  return {};
1✔
32
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc