mb-rag 1.1.31__tar.gz → 1.1.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mb-rag might be problematic. Click here for more details.
- {mb_rag-1.1.31 → mb_rag-1.1.32}/PKG-INFO +1 -1
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/chatbot/basic.py +16 -21
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/version.py +1 -1
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag.egg-info/PKG-INFO +1 -1
- {mb_rag-1.1.31 → mb_rag-1.1.32}/README.md +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/__init__.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/chatbot/__init__.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/chatbot/chains.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/chatbot/prompts.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/rag/__init__.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/rag/embeddings.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/utils/__init__.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/utils/bounding_box.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/utils/document_extract.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/utils/extra.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag/utils/pdf_extract.py +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag.egg-info/SOURCES.txt +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag.egg-info/dependency_links.txt +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag.egg-info/requires.txt +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/mb_rag.egg-info/top_level.txt +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/pyproject.toml +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/setup.cfg +0 -0
- {mb_rag-1.1.31 → mb_rag-1.1.32}/setup.py +0 -0
|
@@ -148,11 +148,11 @@ class ModelFactory:
|
|
|
148
148
|
if not check_package("langchain_ollama"):
|
|
149
149
|
raise ImportError("Langchain Community package not found. Please install it using: pip install langchain_ollama")
|
|
150
150
|
|
|
151
|
-
from langchain_ollama import
|
|
151
|
+
from langchain_ollama import ChatOllama
|
|
152
152
|
|
|
153
153
|
print(f"Current Ollama serve model is {os.system('ollama ps')}")
|
|
154
154
|
kwargs["model"] = model_name
|
|
155
|
-
return
|
|
155
|
+
return ChatOllama(**kwargs)
|
|
156
156
|
|
|
157
157
|
@classmethod
|
|
158
158
|
def create_groq(cls, model_name: str = "llama-3.3-70b-versatile", **kwargs) -> Any:
|
|
@@ -317,26 +317,21 @@ class ModelFactory:
|
|
|
317
317
|
str: Output from the model
|
|
318
318
|
"""
|
|
319
319
|
base64_images = [self._image_to_base64(image) for image in images]
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
else:
|
|
325
|
-
image_prompt_create = [{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{base64_images[i]}"}} for i in range(len(images))]
|
|
326
|
-
prompt_new = [{"type": "text", "text": prompt},
|
|
327
|
-
*image_prompt_create,]
|
|
328
|
-
if pydantic_model is not None:
|
|
329
|
-
try:
|
|
330
|
-
self.model = self.model.with_structured_output(pydantic_model)
|
|
331
|
-
except Exception as e:
|
|
332
|
-
print(f"Error with pydantic_model: {e}")
|
|
333
|
-
print("Continuing without structured output")
|
|
334
|
-
message= HumanMessage(content=prompt_new,)
|
|
335
|
-
response = self.model.invoke([message])
|
|
320
|
+
image_prompt_create = [{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{base64_images[i]}"}} for i in range(len(images))]
|
|
321
|
+
prompt_new = [{"type": "text", "text": prompt},
|
|
322
|
+
*image_prompt_create,]
|
|
323
|
+
if pydantic_model is not None:
|
|
336
324
|
try:
|
|
337
|
-
|
|
338
|
-
except Exception:
|
|
339
|
-
|
|
325
|
+
self.model = self.model.with_structured_output(pydantic_model)
|
|
326
|
+
except Exception as e:
|
|
327
|
+
print(f"Error with pydantic_model: {e}")
|
|
328
|
+
print("Continuing without structured output")
|
|
329
|
+
message= HumanMessage(content=prompt_new,)
|
|
330
|
+
response = self.model.invoke([message])
|
|
331
|
+
try:
|
|
332
|
+
return response.content
|
|
333
|
+
except Exception:
|
|
334
|
+
return response
|
|
340
335
|
|
|
341
336
|
class ConversationModel:
|
|
342
337
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|