File size: 1,201 Bytes
2109241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* LispM LLM training workflow C ABI. SPDX-License-Identifier: AGPL-3.0-only */
#ifndef LISPM_LLM_H
#define LISPM_LLM_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Returns 1 for this ABI. JSON operation documentation: docs/training-workflow.md. */
uint32_t lispm_llm_abi_version(void);

/* Read a UTF-8 NUL-terminated request, return an owned JSON response.
 * Input remains caller-owned and is never retained. Non-null input must remain
 * readable through its terminating NUL for this call. Null is an invalid request.
 * Long operations return a numeric job immediately; poll/cancel/release using JSON.
 * Calls are thread-safe. At most 128 unreleased jobs are retained per library.
 * Keep this library loaded for the process lifetime. Releasing a job is not
 * a thread join, and does not make dlclose safe. Load either this standalone
 * library or the Emacs module in a host, not both copies of the runtime.
 */
char *lispm_llm_request(const char *input);

/* Free a response from this library exactly once; NULL is allowed.
 * Do not pass libc-owned, modified, or already-freed pointers.
 */
void lispm_llm_string_free(char *response);

#ifdef __cplusplus
}
#endif
#endif