### What problem does this PR solve? #6189 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)tags/v0.18.0
| class OllamaEmbed(Base): | class OllamaEmbed(Base): | ||||
| def __init__(self, key, model_name, **kwargs): | def __init__(self, key, model_name, **kwargs): | ||||
| self.client = Client(host=kwargs["base_url"]) | |||||
| self.client = Client(host=kwargs["base_url"]) if not key or key == "x" else \ | |||||
| Client(host=kwargs["base_url"], headers={"Authorization": f"Bear {key}"}) | |||||
| self.model_name = model_name | self.model_name = model_name | ||||
| def encode(self, texts: list): | def encode(self, texts: list): |
| self.headers = { | self.headers = { | ||||
| "Content-Type": "application/json" | "Content-Type": "application/json" | ||||
| } | } | ||||
| if key and key != "x": | |||||
| self.headers["Authorization"] = f"Bear {key}" | |||||
| def tts(self, text, voice="standard-voice"): | def tts(self, text, voice="standard-voice"): | ||||
| payload = { | payload = { |