Skip to content

Commit

Permalink
Fix for ollama name and capabilities for embedding only models (#106)
Browse files Browse the repository at this point in the history
This fixes #105
  • Loading branch information
ahyatt authored Nov 17, 2024
1 parent f7ec12d commit c31309d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llm-ollama.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ PROVIDER is the llm-ollama provider."
(funcall msg-receiver response))))))

(cl-defmethod llm-name ((provider llm-ollama))
(llm-ollama-chat-model provider))
(or (llm-ollama-chat-model provider)
(llm-ollama-embedding-model provider)))

(cl-defmethod llm-chat-token-limit ((provider llm-ollama))
(llm-provider-utils-model-token-limit (llm-ollama-chat-model provider)
Expand All @@ -194,9 +195,9 @@ PROVIDER is the llm-ollama provider."
(and embedding-model
(member 'embedding (llm-model-capabilities embedding-model)))))
'(embeddings embeddings-batch))
(when-let ((chat-model (llm-models-match
(llm-ollama-chat-model provider)))
(capabilities (llm-model-capabilities chat-model)))
(when-let* ((model (llm-ollama-chat-model provider))
(chat-model (llm-models-match model))
(capabilities (llm-model-capabilities chat-model)))
(append
(when (member 'tool-use capabilities) '(function-calls))
(seq-intersection capabilities '(image-input))))))
Expand Down

0 comments on commit c31309d

Please sign in to comment.