7814
Ta
tiny-c-agent / files
tiny-c-agent / src / resolve.h
719 bytes
1// Resolves the configured provider into a concrete endpoint and API. 2 3#ifndef TINY_RESOLVE_H 4#define TINY_RESOLVE_H 5 6#include "config.h" 7#include "provider.h" 8 9// The catalog provider id behind a configured provider id: "opencode-zen" and 10// "opencode" both name the "opencode" catalog. Other ids pass through. 11const char *tiny_provider_canonical(const char *provider); 12 13// Fills `out` from the config. The strings point into `cfg` or the environment, 14// so `cfg` must outlive `out`. Built-in providers use the openai-completions 15// API for now; custom providers use the api written in the config. 16// Returns 0, or -1 with *err set. 17int tiny_resolve_model(const tiny_config *cfg, tiny_model *out, char **err); 18 19#endif