Skip to content
pi-c Documentation
Login

Documentation

/* The web_fetch tool (webfetch.c): GET a public http or https URL and give the model its text.
 * Registered by the composition root (toolreg.h); on by default, replay-safe (a GET), and refused
 * while the offline setting is on. */
#ifndef PIC_WEBFETCH_H
#define PIC_WEBFETCH_H

#include <stddef.h>

#include "toolreg.h"

extern const pic_tool_def pic_webfetch_tool;

/* Shared with web_search (websearch.c): the first column of SQL's first row with ?1 bound to A, as
 * text (malloc'd), or NULL; and IN as valid UTF-8 (malloc'd, *LEN set) without NUL, C0 (but tab,
 * newline and CR), DEL or C1 controls. LATIN1: the bytes are windows-1252. */
char *pic_web_json(const char *sql, const char *a);
char *pic_web_utf8(const char *in, size_t n, int latin1, size_t *len);

#endif