forked from daxa-ai/pebblo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swagger changes in pebblo server APIs (daxa-ai#530)
* Swagger changes in pebblo server APIs * Updating models --------- Co-authored-by: dristy.cd <“[email protected]”>
- Loading branch information
1 parent
7beb672
commit 6a6265e
Showing
5 changed files
with
221 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
"""API Request Model Class""" | ||
|
||
from typing import List, Optional, Union | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class Runtime(BaseModel): | ||
type: str = "local" | ||
host: str | ||
path: str | ||
ip: Optional[str] = None | ||
platform: str | ||
os: str | ||
os_version: str | ||
language: str | ||
language_version: str | ||
runtime: str = "local" | ||
|
||
|
||
class Framework(BaseModel): | ||
name: str | ||
version: str | ||
|
||
|
||
class VectorDB(BaseModel): | ||
name: Optional[str] = None | ||
version: Optional[str] = None | ||
location: Optional[str] = None | ||
embedding_model: Optional[str] = None | ||
|
||
|
||
class Model(BaseModel): | ||
vendor: Optional[str] = None | ||
name: Optional[str] = None | ||
|
||
|
||
class ChainInfo(BaseModel): | ||
name: str | ||
model: Optional[Model] = None | ||
vector_dbs: Optional[List[VectorDB]] = None | ||
|
||
|
||
class ReqDiscover(BaseModel): | ||
name: str | ||
owner: str | ||
description: Optional[str] = None | ||
load_id: Optional[str] = None | ||
runtime: Runtime | ||
framework: Framework | ||
chains: Optional[List[ChainInfo]] = None | ||
plugin_version: str | ||
client_version: Framework | ||
|
||
|
||
class ReqLoaderDoc(BaseModel): | ||
name: str | ||
owner: str | ||
docs: list[dict] = None | ||
plugin_version: str | ||
load_id: str | ||
loader_details: dict | ||
loading_end: bool | ||
source_owner: str | ||
classifier_location: str | ||
|
||
|
||
class Context(BaseModel): | ||
retrieved_from: Optional[str] = None | ||
doc: Optional[str] = None | ||
vector_db: str | ||
pb_checksum: Optional[str] = None | ||
|
||
|
||
class Prompt(BaseModel): | ||
data: Optional[Union[list, str]] = None | ||
entityCount: Optional[int] = None | ||
entities: Optional[dict] = None | ||
prompt_gov_enabled: Optional[bool] = None | ||
|
||
|
||
class ReqPrompt(BaseModel): | ||
name: str | ||
context: Optional[List[Context]] = None | ||
prompt: Optional[Prompt] = None | ||
response: Optional[Prompt] = None | ||
prompt_time: str | ||
user: str | ||
user_identities: Optional[List[str]] = None | ||
classifier_location: str | ||
|
||
|
||
class ReqPromptGov(BaseModel): | ||
prompt: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.