Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jul 10, 2023
2 parents f81ebbe + 5b143b3 commit 7efc5e7
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 376 deletions.
3 changes: 3 additions & 0 deletions src/conversation-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ container_name := ghcr.io/clemlesne/private-gpt/$(component_name)
install:
python3 -m pip install -r requirements.txt

upgrade:
pur -r requirements.txt

test:
@echo "➡️ Running Black..."
python3 -m black --check .
Expand Down
4 changes: 2 additions & 2 deletions src/conversation-api/persistence/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ async def message_search(self, q: str, user_id: UUID) -> SearchModel[MessageMode
except Exception:
logger.warn("Error parsing index message", exc_info=True)

messages = self.store.message_get_index(index_messages)
messages = await self.store.message_get_index(index_messages)

return SearchModel[MessageModel](
answers=[
SearchAnswerModel[MessageModel](data=m, score=s)
for m, s in zip(messages, [r.score for r in raws])
for m, s in zip(messages, [raw.score for raw in raws])
],
query=q,
stats=SearchStatsModel(total=total, time=time.monotonic() - start),
Expand Down
8 changes: 4 additions & 4 deletions src/conversation-api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ azure-ai-contentsafety==1.0.0b1
azure-cosmos==4.4.0
azure-identity==1.13.0
azure-monitor-opentelemetry==1.0.0b13
fastapi==0.95.2
fastapi==0.100.0
mmh3==4.0.0
openai==0.27.7
openai==0.27.8
opentelemetry-instrumentation-fastapi==0.38b0
opentelemetry-instrumentation-redis==0.38b0
opentelemetry-instrumentation-requests==0.38b0
opentelemetry-instrumentation-system-metrics==0.38b0
opentelemetry-instrumentation-urllib3==0.38b0
pyjwt[crypto]==2.7.0
python-dotenv==1.0.0
qdrant-client==1.1.7
redis==4.5.5
qdrant-client==1.3.1
redis==4.6.0
sse-starlette==1.6.1
tenacity==8.2.2
tiktoken==0.4.0
Expand Down
5 changes: 3 additions & 2 deletions src/conversation-api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ def hash_token(str: Union[str, Hashable]) -> UUID:


class VerifyToken:
jwks_client = jwt.PyJWKClient(OIDC_JWKS, cache_keys=True)

def __init__(self, token):
self.token = token
self.jwks_client = jwt.PyJWKClient(OIDC_JWKS)

def verify(self) -> Dict[str, str]:
try:
Expand Down Expand Up @@ -242,4 +243,4 @@ def verify(self) -> Dict[str, str]:
)
def _load_jwks(self) -> None:
logging.debug("Loading signing key from JWT")
self.signing_key = self.jwks_client.get_signing_key_from_jwt(self.token)
self.signing_key = VerifyToken.jwks_client.get_signing_key_from_jwt(self.token)
2 changes: 1 addition & 1 deletion src/conversation-ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ install:
npm install

upgrade:
npm update
npm update --save

test:
@echo "➡️ Scanning for outdated dependencies..."
Expand Down
Loading

0 comments on commit 7efc5e7

Please sign in to comment.