View source: R/custom_model_manager.R
| register_custom_provider | R Documentation |
Register a custom LLM provider
register_custom_provider(provider_name, process_fn, description = NULL)
provider_name |
Unique name for the custom provider |
process_fn |
Function that processes LLM requests. Must accept parameters: prompt, model, api_key; may optionally accept model_config |
description |
Optional description of the provider |
Invisible NULL
## Not run:
register_custom_provider(
provider_name = "my_provider",
process_fn = function(prompt, model, api_key) {
# Custom implementation
response <- httr::POST(
url = "your_api_endpoint",
body = list(prompt = prompt),
encode = "json"
)
return(httr::content(response)$choices[[1]]$text)
}
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.