Skip to content

Commit

Permalink
Support for GROQ API #65
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinfrlch committed Sep 15, 2024
1 parent a862e6f commit 79eab54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/llmvision/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
ERROR_OPENAI_NOT_CONFIGURED = "OpenAI provider is not configured"
ERROR_ANTHROPIC_NOT_CONFIGURED = "Anthropic provider is not configured"
ERROR_GOOGLE_NOT_CONFIGURED = "Google provider is not configured"
ERROR_GROQ_NOT_CONFIGURED = "Groq provider is not configured"
ERROR_LOCALAI_NOT_CONFIGURED = "LocalAI provider is not configured"
ERROR_OLLAMA_NOT_CONFIGURED = "Ollama provider is not configured"
ERROR_CUSTOM_OPENAI_NOT_CONFIGURED = "Custom OpenAI provider is not configured"
Expand Down
5 changes: 5 additions & 0 deletions custom_components/llmvision/request_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ERROR_OPENAI_NOT_CONFIGURED,
ERROR_ANTHROPIC_NOT_CONFIGURED,
ERROR_GOOGLE_NOT_CONFIGURED,
ERROR_GROQ_NOT_CONFIGURED,
ERROR_LOCALAI_NOT_CONFIGURED,
ERROR_OLLAMA_NOT_CONFIGURED,
ERROR_NO_IMAGE_INPUT
Expand Down Expand Up @@ -396,6 +397,10 @@ def _validate_call(self, provider, api_key, base64_images, ip_address=None, port
elif provider == 'Google':
if not api_key:
raise ServiceValidationError(ERROR_GOOGLE_NOT_CONFIGURED)
# Checks for Groq
elif provider == 'Groq':
if not api_key:
raise ServiceValidationError(ERROR_GROQ_NOT_CONFIGURED)
# Checks for LocalAI
elif provider == 'LocalAI':
if not ip_address or not port:
Expand Down

0 comments on commit 79eab54

Please sign in to comment.