Skip to content

Commit

Permalink
pyupgrade (#4482)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: cb2a1086052756836797431a0d5b7666d02072af
  • Loading branch information
embe-pw authored and Manul from Pathway committed Sep 25, 2023
1 parent bfc4b1a commit 4223e28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions llm_app/model_wrappers/api_clients/clients.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from abc import ABC, abstractmethod
from typing import Optional

import requests

Expand All @@ -17,9 +16,9 @@ class OpenAIClient(APIClient):
def __init__(
self,
api_key: str,
api_type: Optional[str] = None,
api_base: Optional[str] = None,
api_version: Optional[str] = None,
api_type: str | None = None,
api_base: str | None = None,
api_version: str | None = None,
):
import openai

Expand Down
3 changes: 1 addition & 2 deletions llm_app/model_wrappers/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import functools
import os
from abc import ABC
from typing import Union

import diskcache
import pathway as pw
Expand Down Expand Up @@ -38,7 +37,7 @@ def __call__(self, text: str, **kwargs):

def apply(
self,
text: Union[pw.ColumnExpression, str],
text: pw.ColumnExpression | str,
**kwargs,
) -> pw.ColumnExpression:
return pw.apply_async(self.cache(self.__call__), text=text, **kwargs)

0 comments on commit 4223e28

Please sign in to comment.