The embedding API functions (ollama_embedding(), openai_embedding(), mistral_embedding(), etc.) currently do not have full test coverage. While the chat model side has comprehensive tests, the embedding functions need tests to ensure their correctness, particularly for handling edge cases, error handling, and integration with various models and APIs.
Possible Actions
Write Unit Tests for Embedding Functions:
Write tests to ensure that embedding functions (ollama_embedding(), openai_embedding(), mistral_embedding()) behave as expected across different scenarios, including:
Valid inputs (both LLMMessage objects and character vectors).
Return a valid request via .dry_run
Mocking of API Requests with httptest2:
Implement mock API responses similar to the chat model functions
Ensure that the functions return the correct results based on the simulated API responses.
Test Input Validation:
Validate that all input validation logic works as expected:
Ensuring correct data types for .llm, .model, .truncate, .timeout, etc.
Description
The embedding API functions (
ollama_embedding()
,openai_embedding()
,mistral_embedding()
, etc.) currently do not have full test coverage. While the chat model side has comprehensive tests, the embedding functions need tests to ensure their correctness, particularly for handling edge cases, error handling, and integration with various models and APIs.Possible Actions
Write Unit Tests for Embedding Functions:
ollama_embedding()
,openai_embedding()
,mistral_embedding()
) behave as expected across different scenarios, including:LLMMessage
objects and character vectors)..dry_run
Mocking of API Requests with
httptest2
:Test Input Validation:
.llm
,.model
,.truncate
,.timeout
, etc.