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

Commit

Permalink
Merge branch 'main' into anthropic-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
patcher9 authored Mar 10, 2024
2 parents 445f553 + 99c9ff6 commit 33cf19f
Show file tree
Hide file tree
Showing 2 changed files with 465 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dokumetry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"""
from anthropic import AsyncAnthropic, Anthropic

from openai import AsyncOpenAI, OpenAI

from .openai import init as init_openai
from .async_openai import init as init_async_openai
from .anthropic import init as init_anthropic
from .async_anthropic import init as init_async_anthropic
from .cohere import init as init_cohere
Expand Down Expand Up @@ -44,7 +47,10 @@ def init(llm, doku_url, api_key, environment="default", application_name="defaul

# pylint: disable=no-else-return, line-too-long
if hasattr(llm, 'moderations') and callable(llm.chat.completions.create) and ('.openai.azure.com/' not in str(llm.base_url)):
init_openai(llm, doku_url, api_key, environment, application_name, skip_resp)
if isinstance(llm, OpenAI):
init_openai(llm, doku_url, api_key, environment, application_name, skip_resp)
elif isinstance(llm, AsyncOpenAI):
init_async_openai(llm, doku_url, api_key, environment, application_name, skip_resp)
return
# pylint: disable=no-else-return
elif hasattr(llm, 'generate') and callable(llm.generate):
Expand Down
Loading

0 comments on commit 33cf19f

Please sign in to comment.