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 Mar 8, 2024
1 parent 136a8b4 commit 445f553
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dokumetry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
__init__ module for dokumetry package.
"""
from anthropic import AsyncAnthropic, Anthropic

from .openai import init as init_openai
from .anthropic import init as init_anthropic
from .async_anthropic import init as init_async_anthropic
from .cohere import init as init_cohere
from anthropic import AsyncAnthropic, Anthropic

# pylint: disable=too-few-public-methods
class DokuConfig:
Expand Down
4 changes: 3 additions & 1 deletion src/dokumetry/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def init(llm, doku_url, api_key, environment, application_name, skip_resp):

original_messages_create = llm.messages.create

#pylint: disable=too-many-locals
def patched_messages_create(*args, **kwargs):
"""
Patched version of Anthropic's messages.create method.
Expand All @@ -35,6 +36,8 @@ def patched_messages_create(*args, **kwargs):
"""
streaming = kwargs.get('stream', False)
start_time = time.time()

# pylint: disable=no-else-return
if streaming:
def stream_generator():
accumulated_content = ""
Expand Down Expand Up @@ -86,7 +89,6 @@ def stream_generator():
send_data(data, doku_url, api_key)

return stream_generator()
# pylint disable=no-else-return
else:
start_time = time.time()
response = original_messages_create(*args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions src/dokumetry/async_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def init(llm, doku_url, api_key, environment, application_name, skip_resp):

original_messages_create = llm.messages.create

#pylint: disable=too-many-locals
async def patched_messages_create(*args, **kwargs):
"""
Patched version of Anthropic's messages.create method.
Expand Down

0 comments on commit 445f553

Please sign in to comment.