From 60fa35f2596b43b354c665ce5e06facbe250bf67 Mon Sep 17 00:00:00 2001 From: Alexander Schaber Date: Tue, 25 Jun 2024 12:48:18 +0200 Subject: [PATCH] feat: Update Ollama manifold pipeline to use environment variable for base URL --- examples/pipelines/providers/ollama_manifold_pipeline.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/pipelines/providers/ollama_manifold_pipeline.py b/examples/pipelines/providers/ollama_manifold_pipeline.py index 4393b3de..ec5c3b86 100644 --- a/examples/pipelines/providers/ollama_manifold_pipeline.py +++ b/examples/pipelines/providers/ollama_manifold_pipeline.py @@ -1,5 +1,7 @@ from typing import List, Union, Generator, Iterator from schemas import OpenAIChatMessage +import os + from pydantic import BaseModel import requests @@ -24,7 +26,11 @@ def __init__(self): # Optionally, you can set the name of the manifold pipeline. self.name = "Ollama: " - self.valves = self.Valves(**{"OLLAMA_BASE_URL": "http://localhost:11435"}) + self.valves = self.Valves( + **{ + "OLLAMA_BASE_URL": os.getenv("OLLAMA_BASE_URL", "http://localhost:11435"), + } + ) self.pipelines = [] pass