Skip to content

Commit

Permalink
feat: update deps, fix stats
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Jan 31, 2024
1 parent febe770 commit 1f4ffbe
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 deletions.
50 changes: 19 additions & 31 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ langchain = "^0.0.354"
faiss-cpu = "^1.7.4"
unstructured = "^0.11.8"
libmagic = "^1.0"
openai = "^1.6.1"
openai = "^0.28.1"
tiktoken = "^0.5.2"
fastapi = "^0.108.0"
fastapi = "^0.109.0"
pydantic = "^2.5.3"
pydantic-settings = "^2.1.0"
uvicorn = "^0.25.0"
Expand Down
9 changes: 7 additions & 2 deletions web/answering.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ async def generate_answer(question: str, collection):
# track event
await send_event('all', 'qa', {**{"question": question, "collection": collection, "instances": instances}, **cb.__dict__})

output['stats'] = cb

output['stats'] = {
'total_cost': cb.total_cost,
'total_tokens': cb.total_tokens,
'prompt_tokens': cb.prompt_tokens,
'completion_tokens': cb.completion_tokens,
'successful_requests': cb.successful_requests,
}
return output


Expand Down

0 comments on commit 1f4ffbe

Please sign in to comment.