mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
update chroma chat
This commit is contained in:
@ -4,6 +4,9 @@ from fastapi import Request, Response, status
|
||||
from fastapi.responses import JSONResponse
|
||||
from .blackbox import Blackbox
|
||||
|
||||
from ..utils import chroma_setting
|
||||
DEFAULT_COLLECTION_ID = "123"
|
||||
|
||||
from injector import singleton
|
||||
@singleton
|
||||
class ChromaChat(Blackbox):
|
||||
@ -19,13 +22,13 @@ class ChromaChat(Blackbox):
|
||||
data = args[0]
|
||||
return isinstance(data, list)
|
||||
|
||||
def processing(self, question, context) -> str:
|
||||
def processing(self, question, setting: chroma_setting) -> str:
|
||||
|
||||
# load or create collection
|
||||
if context is None:
|
||||
collection_id = "123"
|
||||
if setting is None:
|
||||
collection_id = DEFAULT_COLLECTION_ID
|
||||
else:
|
||||
collection_id = context["collections"][0]
|
||||
collection_id = setting.ChromaSetting.collection_ids[0]
|
||||
# query it
|
||||
chroma_result = self.chroma_query(question, collection_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user