Skip to content

Commit

Permalink
feat: vendoring of openai
Browse files Browse the repository at this point in the history
  • Loading branch information
csgulati09 committed Jun 7, 2024
1 parent 623260f commit af012a7
Show file tree
Hide file tree
Showing 283 changed files with 35,594 additions and 31 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
GIT_ROOT ?= $(shell git rev-parse --show-toplevel)
EXCLUDE_DIRS := portkey_ai/_vendor,venv
help: ## Show all Makefile targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: format lint
format: ## Run code formatter: black
black .
ruff check . --fix
ruff check . --fix --exclude $(EXCLUDE_DIRS)
lint: ## Run linters: mypy, black, ruff
mypy .
black . --check
ruff check .
mypy . --exclude portkey_ai/_vendor --exclude venv
black . --check --exclude portkey_ai/_vendor --exclude venv
ruff check . --exclude $(EXCLUDE_DIRS)
test: ## Run tests
pytest tests
watch-docs: ## Build and watch documentation
sphinx-autobuild docs/ docs/_build/html --open-browser --watch $(GIT_ROOT)/llama_index/

build:
mypy .
black . --check
ruff check .
mypy . --exclude portkey_ai/_vendor --exclude venv
black . --check --exclude portkey_ai/_vendor --exclude venv
ruff check . --exclude $(EXCLUDE_DIRS)
rm -rf dist/ build/
python -m pip install build
python -m build .
Expand Down
2 changes: 2 additions & 0 deletions portkey_ai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from typing import Mapping, Optional, Union
from ._vendor import openai
from portkey_ai.api_resources import (
LLMOptions,
Modes,
Expand Down Expand Up @@ -143,4 +144,5 @@
"AsyncVectorStores",
"AsyncVectorFiles",
"AsyncVectorFileBatches",
"openai",
]
Empty file added portkey_ai/_vendor/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions portkey_ai/_vendor/bin/openai
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/Users/chandeep/Documents/Workspace/Portkey/SDK/portkey-python-sdk/venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from openai.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
1 change: 1 addition & 0 deletions portkey_ai/_vendor/openai-1.26.0.dist-info/INSTALLER
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip
Loading

0 comments on commit af012a7

Please sign in to comment.