Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
patcher9 committed Feb 11, 2024
1 parent a7a02da commit 0620e6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/dokumetry/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ def stream_generator():
accumulated_content = ""
for event in original_chat(*args, **kwargs):
if event.event_type == "stream-start":
responseId = event.generation_id
response_id = event.generation_id
if event.event_type == "text-generation":
accumulated_content += event.text
yield event
end_time = time.time()
duration = end_time - start_time
prompt = kwargs.get('message')
data = {
"llmReqId": responseId,
"llmReqId": response_id,
"environment": environment,
"applicationName": application_name,
"sourceLanguage": "python",
Expand Down Expand Up @@ -242,9 +242,9 @@ def summarize_generate(*args, **kwargs):
prompt = kwargs.get('text')

data = {
"applicationName": application_name,
"llmReqId": response.id,
"environment": environment,
"applicationName": application_name,
"sourceLanguage": "python",
"endpoint": "cohere.summarize",
"skipResp": skip_resp,
Expand Down
8 changes: 4 additions & 4 deletions src/dokumetry/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def stream_generator():
if content:
accumulated_content += content
yield chunk
responseId = chunk.id
response_id = chunk.id
end_time = time.time()
duration = end_time - start_time
message_prompt = kwargs.get('messages', "No prompt provided")
Expand All @@ -75,8 +75,8 @@ def stream_generator():

prompt = "\n".join(formatted_messages)
data = {
"llmReqId": responseId,
"environment": environment,
"llmReqId": response_id,
"applicationName": application_name,
"sourceLanguage": "python",
"endpoint": "openai.chat.completions",
Expand Down Expand Up @@ -175,12 +175,12 @@ def stream_generator():
if content:
accumulated_content += content
yield chunk
responseId = chunk.id
response_id = chunk.id
end_time = time.time()
duration = end_time - start_time
prompt = kwargs.get('prompt', "No prompt provided")
data = {
"llmReqId": responseId,
"llmReqId": response_id,
"environment": environment,
"applicationName": application_name,
"sourceLanguage": "python",
Expand Down

0 comments on commit 0620e6d

Please sign in to comment.