Skip to content

Commit

Permalink
removed dependancy on _models.py and add snip from _types.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gittb committed Oct 20, 2024
1 parent 53aae17 commit 01f41ec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lmos_openai_types/_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from typing import Union, Optional, Mapping, IO, Tuple
from os import PathLike

# manually pulled from OAI
FileContent = Union[IO[bytes], bytes, PathLike[str]]

FileTypes = Union[
# file (or bytes)
FileContent,
# (filename, file (or bytes))
Tuple[Optional[str], FileContent],
# (filename, file (or bytes), content_type)
Tuple[Optional[str], FileContent, Optional[str]],
# (filename, file (or bytes), content_type, headers)
Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]],
]
2 changes: 2 additions & 0 deletions runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def main():
shutil.move(source_dir, dest_dir)
shutil.rmtree("openai-package")

run_command("""find lmos_openai_types -type f -name "*.py" -print0 | xargs -0 sed -i 's/^.*import BaseModel.*$/from pydantic import BaseModel/g'""")

# Add all changes
run_command("git add .")

Expand Down

0 comments on commit 01f41ec

Please sign in to comment.