mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-27 11:19:54 -04:00
pep8
This commit is contained in:
parent
073f67522a
commit
cfb2e7566e
@ -30,7 +30,7 @@ class Model(NamedTuple):
|
||||
owner: str
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, x: dict[str, Any]) -> 'Model':
|
||||
def from_dict(cls, x: dict[str, Any]) -> Model:
|
||||
return cls(id=x['id'], owner=x.get('owned_by', 'remote'))
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ def as_chat_responses(d: dict[str, Any], model_id: str) -> Iterator[ChatResponse
|
||||
if blocked:
|
||||
yield ChatResponse(exception=ResultBlocked(ResultBlockReason.safety), plugin_name=OpenAICompatible.name)
|
||||
return
|
||||
if usage := d.get('usage'):
|
||||
if d.get('usage'):
|
||||
yield ChatResponse(
|
||||
has_metadata=True, provider=OpenAICompatible.name, model=d.get('model') or model_id,
|
||||
plugin_name=OpenAICompatible.name
|
||||
|
||||
@ -8,8 +8,8 @@ from calibre.ai.github import GitHubAI
|
||||
from calibre.ai.google import GoogleAI
|
||||
from calibre.ai.lm_studio import LMStudioAI
|
||||
from calibre.ai.ollama import OllamaAI
|
||||
from calibre.ai.openai_compatible import OpenAICompatible
|
||||
from calibre.ai.open_router import OpenRouterAI
|
||||
from calibre.ai.openai_compatible import OpenAICompatible
|
||||
from calibre.constants import numeric_version
|
||||
from calibre.customize import FileTypePlugin, InterfaceActionBase, MetadataReaderPlugin, MetadataWriterPlugin, PreferencesPlugin, StoreBase
|
||||
from calibre.ebooks.html.to_zip import HTML2ZIP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user