LazyDoc.Providers.GithubAi (LazyDoc v0.4.0)
## Main functionality
The module LazyDoc.Providers.GithubAi provides a way of interacting with the Github AI API for prompt-based communication and response generation.
## Description
It implements the behavior Provider, offering a standardized method to request and retrieve responses from AI models hosted on the Github AI platform. Key operations include sending prompts, constructing API requests, and processing responses.
Summary
Functions
Parameters
- params - a list of parameters to check, where each parameter is a tuple containing a key and a value.
Description
Validates if all keys in the params list match the accepted parameters.
Parameters
Parameters
Functions
Parameters
- params - a list of parameters to check, where each parameter is a tuple containing a key and a value.
Description
Validates if all keys in the params list match the accepted parameters.
Returns
true if all parameters are valid; false otherwise.
@spec get_docs_from_response(Req.Response.t()) :: binary()
Parameters
response - a %Req.Response struct containing the response from an HTTP request. Description Parses the body of the HTTP response and extracts the message content from it.
Returns the content of the message extracted from the response body.
Parameters
model - a symbol representing the model type. Description Maps the provided model symbol to its corresponding string representation.
Returns the string representation of the specified model.
Parameters
prompt - the input text or question to be sent to the model. model - the identifier for the specific model to use for generating a response. token - the authorization token required for accessing the API.
Description Constructs a request to query an AI model with a given prompt and specified parameters.
Returns a structured request object ready to interact with the API at the configured endpoint.
@spec request_prompt(binary(), binary(), binary(), keyword()) :: {:ok, Req.Response.t()} | {:error, Exception.t()}
Parameters
prompt - the input message to be processed by the model. model - the identifier for the specific AI model to be used. token - the authorization token for accessing the AI service.
Description Sends a prompt to an AI model and returns the generated response.
Returns the response generated by the AI model based on the provided prompt.