mb-rag 1.1.30__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mb_rag
3
- Version: 1.1.30
3
+ Version: 1.1.32
4
4
  Summary: RAG function file
5
5
  Author: ['Malav Bateriwala']
6
6
  Requires-Python: >=3.8
@@ -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 OllamaLLM
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 OllamaLLM(**kwargs)
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
- if self.model_type =='ollama':
321
- ollama_model = self.model.bind(images=[base64_images])
322
- response = ollama_model.invoke([HumanMessage(content=prompt)])
323
- return response.content
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
- return response.content
338
- except Exception:
339
- return response
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
  """
@@ -1,5 +1,5 @@
1
1
  MAJOR_VERSION = 1
2
2
  MINOR_VERSION = 1
3
- PATCH_VERSION = 30
3
+ PATCH_VERSION = 32
4
4
  version = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
5
5
  __all__ = ['MAJOR_VERSION', 'MINOR_VERSION', 'PATCH_VERSION', 'version']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mb_rag
3
- Version: 1.1.30
3
+ Version: 1.1.32
4
4
  Summary: RAG function file
5
5
  Author: ['Malav Bateriwala']
6
6
  Requires-Python: >=3.8
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes