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

gregreindel / llm-exe / 16405756153

21 Jul 2025 12:15AM UTC coverage: 99.458%. First build
16405756153

Pull #107

github

web-flow
Merge fdd9db7ea into e3128b1ea
Pull Request #107: export function for createLlmFunctionExecutor, add error if using dia…

932 of 939 branches covered (99.25%)

Branch coverage included in aggregate %.

12 of 14 new or added lines in 4 files covered. (85.71%)

2187 of 2197 relevant lines covered (99.54%)

29.74 hits per line

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

88.89
/src/executor/_functions.ts
1
import {
2
  BaseLlm,
3
  PlainObject,
4
  ExecutorWithLlmOptions,
5
  CoreExecutorExecuteOptions,
6
  LlmExecutorHooks,
7
} from "@/types";
8
import { BaseParser } from "@/parser";
9
import { BasePrompt } from "@/prompt";
10
import { BaseState } from "@/state";
11
import { CoreExecutor } from "./core";
8✔
12
import { LlmExecutor } from "./llm";
8✔
13
import { LlmExecutorWithFunctions } from "./llm-openai-function";
8✔
14

15
/**
16
 * Function to create a core executor.
17
 * @template I - Input type.
18
 * @template O - Output type.
19
 * @param handler - The handler function.
20
 * @returns - A new CoreExecutor instance.
21
 */
22
export function createCoreExecutor<I extends PlainObject, O>(
8✔
23
  handler: (input: I) => Promise<O> | O,
24
  options?: CoreExecutorExecuteOptions
25
) {
26
  return new CoreExecutor<I, O>({ handler }, options);
15✔
27
}
28

29
/**
30
 * Function to create a core executor with Llm.
31
 * @template Llm - Llm type.
32
 * @template Prompt - Prompt type.
33
 * @template Parser - Parser type.
34
 * @template State - State type.
35
 * @param options - Options for BaseExecutorV3.
36
 * @returns  - A new LlmExecutor instance.
37
 */
38
export function createLlmExecutor<
8✔
39
  Llm extends BaseLlm<any>,
40
  Prompt extends BasePrompt<any>,
41
  Parser extends BaseParser,
42
  State extends BaseState,
43
>(
44
  llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>,
45
  options?: CoreExecutorExecuteOptions<LlmExecutorHooks>
46
) {
47
  return new LlmExecutor<Llm, Prompt, Parser, State>(llmConfiguration, options);
1✔
48
}
49

50
export function createLlmFunctionExecutor<
8✔
51
  Llm extends BaseLlm,
52
  Prompt extends BasePrompt<Record<string, any>>,
53
  Parser extends BaseParser,
54
  State extends BaseState,
55
>(
56
  llmConfiguration: ExecutorWithLlmOptions<Llm, Prompt, Parser, State>,
57
  options?: CoreExecutorExecuteOptions<LlmExecutorHooks>
58
) {
NEW
59
  return new LlmExecutorWithFunctions<Llm, Prompt, Parser, State>(
×
60
    llmConfiguration,
61
    options
62
  );
63
}
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