Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/wrapper #90

Merged
merged 64 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
4620295
feat: revamp- wrapper around openai sdk
csgulati09 Feb 20, 2024
eb9ff46
feat: raw response and with streaming for completion and chat completion
csgulati09 Feb 22, 2024
c2aaa17
feat: added files route support
csgulati09 Feb 23, 2024
fcc42ad
fix: linting issues fixed
csgulati09 Feb 23, 2024
7904026
feat: added and test cases for newly added routes
csgulati09 Feb 24, 2024
31b6079
Merge branch 'main' into feat/wrapper
csgulati09 Feb 24, 2024
24e98e6
fix: linting issues
csgulati09 Feb 26, 2024
d0c25cb
fix: removed comments
csgulati09 Mar 2, 2024
b18f0a1
fix: linting fixed
csgulati09 Mar 2, 2024
70d7662
feat: added models method + versioning for openai sdk
csgulati09 Mar 5, 2024
2cec8e1
fix: linting issues
csgulati09 Mar 5, 2024
ac61c7d
feat: suggestion for DevEx
csgulati09 Mar 7, 2024
7c41ac9
fix: removed image test models fro anyscale tests
csgulati09 Mar 9, 2024
f7eb4c5
fix: removed image test models from cohere, anthropic tests
csgulati09 Mar 9, 2024
efa0109
fix: removed unsupported providers test cases
csgulati09 Mar 9, 2024
30eeda1
fix: removed comments
csgulati09 Mar 9, 2024
c59e174
fix: following snake_case
csgulati09 Mar 9, 2024
e2d266c
fix: support for openai 1.x.x till 1.13.0
csgulati09 Mar 9, 2024
38a68d9
fix: threads and assistants test cases fixed
csgulati09 Mar 9, 2024
354a10e
feat: get_headers() for embeddings + x-portkey-headers for all the he…
csgulati09 Mar 13, 2024
ab20abb
feat: get_headers for complete and chat_complete
csgulati09 Mar 13, 2024
6d44dd0
feat: get_headers for images
csgulati09 Mar 13, 2024
ebfe2e6
feat: get_headers for models and files
csgulati09 Mar 13, 2024
37dd886
fix: linting issues
csgulati09 Mar 13, 2024
7e4c5db
feat: get_headers for assistants and assistants files
csgulati09 Mar 13, 2024
25e5cbf
fix: linting issues
csgulati09 Mar 13, 2024
b102727
feat: get_headers for threads and following sub methods
csgulati09 Mar 13, 2024
4218138
fix: test cases for assistants and threads
csgulati09 Mar 16, 2024
f877ebe
fix: linting issues
csgulati09 Mar 16, 2024
2c76879
fix: openai specific test cases
csgulati09 Mar 16, 2024
b8476be
chore: update models json with latest provider models
VisargD Mar 16, 2024
9ae35af
feat: default models
csgulati09 Mar 16, 2024
c84bdcf
fix: linting issues
csgulati09 Mar 16, 2024
2c5fbea
fix: default model name typo
csgulati09 Mar 16, 2024
3aeef46
fix: base_url
csgulati09 Mar 18, 2024
691f751
fix: linting issue
csgulati09 Mar 18, 2024
9a4ff45
chore: allow 1.0 to 2.0 openai package version
VisargD Mar 18, 2024
58bfc50
chore: update openai test model list
VisargD Mar 18, 2024
014a6dd
chore: update test case configs with override models and remove provi…
VisargD Mar 18, 2024
16bbae6
fix: Bearer in authorization headers
csgulati09 Mar 18, 2024
be24c0f
fix: linting issues
csgulati09 Mar 18, 2024
0e526cf
chore: add stream chunk test util functions
VisargD Mar 19, 2024
617574b
chore: remove bearer from test cases authorization param
VisargD Mar 19, 2024
aac9ad7
chore: formatting changes
VisargD Mar 20, 2024
6b96afc
chore: add strict test cases to check response values and types
VisargD Mar 20, 2024
44a1d71
feat: types for each route
csgulati09 Mar 20, 2024
666a167
fix: linting issues
csgulati09 Mar 20, 2024
3a46397
fix: add await in async chat complete test case
VisargD Mar 20, 2024
b0b6613
fix: auto complete for chat and completion + utils for types directory
csgulati09 Mar 20, 2024
9ae3b79
chore: update chat stream chunk assert check
VisargD Mar 20, 2024
296e8a4
feat: suggestion for embedding and image.generate
csgulati09 Mar 21, 2024
ca47939
feat: auto complete suggestions for complete route
csgulati09 Mar 21, 2024
7076204
feat: auto complete suggestions for chat complete
csgulati09 Mar 21, 2024
04dfca3
feat: auto suggestion for all image routes
csgulati09 Mar 21, 2024
08e8bc2
feat: auto complete suggestions for models route
csgulati09 Mar 21, 2024
d1b5519
Merge pull request #94 from Portkey-AI/wrapper/suggestions
VisargD Mar 21, 2024
f5cbce8
chore: add loadbalance and fallback test cases for images
VisargD Mar 21, 2024
4e7ff81
chore: fix loadbalance and fallback test cases for images
VisargD Mar 21, 2024
1856236
chore: update assistants test cases
VisargD Mar 21, 2024
ed44eaf
chore: remove unused comments
VisargD Mar 21, 2024
8cf27d6
fix: add missing await in async chat complete test
VisargD Mar 21, 2024
a2d2ed9
chore: add loadbalance fallback test for async images
VisargD Mar 21, 2024
c4de831
chore: replace segmind with stability ai in test cases
VisargD Mar 21, 2024
d3acb63
chore: replace segmind with stability ai in test cases
VisargD Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 41 additions & 8 deletions portkey_ai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,40 @@
CacheLiteral,
Message,
PortkeyResponse,
ChatCompletions,
Completion,
AsyncCompletion,
Params,
Config,
RetrySettings,
ChatCompletion,
AsyncChatCompletion,
ChatCompletionChunk,
TextCompletion,
TextCompletionChunk,
createHeaders,
Prompts,
AsyncPrompts,
Portkey,
AsyncPortkey,
Images,
AsyncImages,
Assistants,
AsyncAssistants,
Threads,
AsyncThreads,
Messages,
AsyncMessages,
MainFiles,
AsyncMainFiles,
Models,
AsyncModels,
ThreadFiles,
AsyncThreadFiles,
AssistantFiles,
AsyncAssistantFiles,
Runs,
AsyncRuns,
Steps,
AsyncSteps,
)

from portkey_ai.version import VERSION
from portkey_ai.api_resources.global_constants import (
PORTKEY_BASE_URL,
Expand All @@ -51,16 +68,12 @@
"CacheType",
"CacheLiteral",
"Message",
"ChatCompletions",
"Completion",
"AsyncCompletion",
"Params",
"RetrySettings",
"ChatCompletion",
"AsyncChatCompletion",
"ChatCompletionChunk",
"TextCompletion",
"TextCompletionChunk",
"Config",
"api_key",
"base_url",
Expand All @@ -70,4 +83,24 @@
"AsyncPrompts",
"Portkey",
"AsyncPortkey",
"Images",
"AsyncImages",
"Assistants",
"AsyncAssistants",
"Threads",
"AsyncThreads",
"Messages",
"AsyncMessages",
"MainFiles",
"AsyncMainFiles",
"Models",
"AsyncModels",
"ThreadFiles",
"AsyncThreadFiles",
"AssistantFiles",
"AsyncAssistantFiles",
"Runs",
"AsyncRuns",
"Steps",
"AsyncSteps",
]
48 changes: 40 additions & 8 deletions portkey_ai/api_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@
Feedback,
AsyncFeedback,
createHeaders,
Images,
AsyncImages,
Assistants,
AsyncAssistants,
Threads,
AsyncThreads,
Messages,
AsyncMessages,
MainFiles,
AsyncMainFiles,
Models,
AsyncModels,
ThreadFiles,
AsyncThreadFiles,
AssistantFiles,
AsyncAssistantFiles,
Runs,
AsyncRuns,
Steps,
AsyncSteps,
)
from .utils import (
Modes,
Expand All @@ -25,10 +45,6 @@
Params,
Config,
RetrySettings,
ChatCompletions,
ChatCompletionChunk,
TextCompletion,
TextCompletionChunk,
)
from .client import Portkey, AsyncPortkey

Expand All @@ -45,17 +61,13 @@
"CacheType",
"CacheLiteral",
"Message",
"ChatCompletions",
"Completion",
"AsyncCompletion",
"Params",
"Config",
"RetrySettings",
"ChatCompletion",
"AsyncChatCompletion",
"ChatCompletionChunk",
"TextCompletion",
"TextCompletionChunk",
"Generations",
"AsyncGenerations",
"Prompts",
Expand All @@ -65,4 +77,24 @@
"createHeaders",
"Portkey",
"AsyncPortkey",
"Images",
"AsyncImages",
"Assistants",
"AsyncAssistants",
"Threads",
"AsyncThreads",
"Messages",
"AsyncMessages",
"MainFiles",
"AsyncMainFiles",
"Models",
"AsyncModels",
"ThreadFiles",
"AsyncThreadFiles",
"AssistantFiles",
"AsyncAssistantFiles",
"Runs",
"AsyncRuns",
"Steps",
"AsyncSteps",
]
36 changes: 36 additions & 0 deletions portkey_ai/api_resources/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
from .create_headers import createHeaders
from .post import Post, AsyncPost
from .embeddings import Embeddings, AsyncEmbeddings
from .images import Images, AsyncImages
from .assistants import Assistants, AssistantFiles, AsyncAssistants, AsyncAssistantFiles
from .threads import (
Threads,
Messages,
ThreadFiles,
Runs,
Steps,
AsyncThreads,
AsyncMessages,
AsyncThreadFiles,
AsyncRuns,
AsyncSteps,
)
from .main_files import MainFiles, AsyncMainFiles
from .models import Models, AsyncModels

__all__ = [
"Completion",
Expand All @@ -22,4 +38,24 @@
"AsyncPost",
"Embeddings",
"AsyncEmbeddings",
"Images",
"AsyncImages",
"Assistants",
"AsyncAssistants",
"MainFiles",
"AsyncMainFiles",
"Models",
"AsyncModels",
"AssistantFiles",
"ThreadFiles",
"AsyncAssistantFiles",
"AsyncThreadFiles",
"Threads",
"AsyncThreads",
"Messages",
"AsyncMessages",
"Runs",
"AsyncRuns",
"Steps",
"AsyncSteps",
]
Loading
Loading