-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from BharatSahAIyak/dev
Dev -> Main v3.5.0
- Loading branch information
Showing
44 changed files
with
2,871 additions
and
522 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
from django.conf import settings | ||
import redis | ||
from django.conf import settings | ||
|
||
redis_conn = redis.Redis( | ||
host=settings.REDIS_HOST, | ||
port=settings.REDIS_PORT, | ||
db=settings.REDIS_DB | ||
) | ||
redis_conn = redis.Redis.from_url(settings.REDIS_URL) |
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
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,53 @@ | ||
# Endpoint | ||
|
||
GET /status-v2/ | ||
|
||
# Request | ||
|
||
### Headers | ||
|
||
- workflow_id | ||
- task_id | ||
|
||
```bash | ||
curl --location 'localhost:8000/status-v2/' | ||
``` | ||
|
||
# Response | ||
|
||
### task_id is provided | ||
|
||
```json | ||
{ | ||
"task_id": "UUID", | ||
"status": "", | ||
"percentage": "" | ||
} | ||
``` | ||
|
||
### workflow_id is provided | ||
|
||
```json | ||
{ | ||
"workflow_id": "UUID", | ||
"status": "", | ||
"task_ids": [] | ||
} | ||
``` | ||
|
||
### If both task_id and workflow_id is provided | ||
|
||
```json | ||
{ | ||
"workflow": { | ||
"workflow_id": "UUID", | ||
"status": "", | ||
"task_ids": [] | ||
}, | ||
"task": { | ||
"task_id": "UUID", | ||
"status": "", | ||
"percentage": "" | ||
} | ||
} | ||
``` |
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,83 @@ | ||
- Will return the workflows for a given user | ||
|
||
# Endpoint | ||
|
||
GET /workflow-v2 and GET /workflow-v2/{workflow_id} | ||
|
||
# Request | ||
|
||
### Headers | ||
|
||
- User Auth | ||
|
||
# Response | ||
|
||
```json | ||
[ | ||
{ | ||
"workflow_id": "<UUID>", | ||
"workflow_name": "String", | ||
"user_id": "<UUID>", | ||
"config": { | ||
"config_name": "QnA", | ||
"system_prompt": "You are a helpful data generation assistant working as a teacher. You are an expert in this field. Don't Hallucinate", | ||
"user_prompt_template": "{{workflow.user_prompt}}", | ||
"temperature": 1, | ||
"schema_example": { | ||
"question": "4 + 5", | ||
"choices": [ | ||
{ | ||
"text": "9", | ||
"score": "1" | ||
}, | ||
{ | ||
"text": "4", | ||
"score": "0" | ||
}, | ||
{ | ||
"text": "2", | ||
"score": "0" | ||
}, | ||
{ | ||
"text": "1", | ||
"score": "0" | ||
} | ||
] | ||
} | ||
}, | ||
"split": [100, 0, 0], | ||
"llm_model": "LLM Models", | ||
"tags": [], | ||
"user_prompt": "", | ||
"cost": "", | ||
"estimated_dataset_cost": "", | ||
"examples": [ | ||
{ | ||
"text": { | ||
"question": "question text", | ||
"choices": [ | ||
{ | ||
"text": "9", | ||
"score": "1" | ||
}, | ||
{ | ||
"text": "4", | ||
"score": "0" | ||
}, | ||
{ | ||
"text": "2", | ||
"score": "0" | ||
}, | ||
{ | ||
"text": "1", | ||
"score": "0" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
``` | ||
|
||
Dataset Cost is estimated based on the tokens used in the previous iteration. |
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,53 @@ | ||
Returns the dataset associated with a given id | ||
|
||
# Endpoint | ||
|
||
POST /workflow-v2/data | ||
|
||
# Request | ||
|
||
### Headers | ||
|
||
- User Auth | ||
- workflow_id | ||
- task_id | ||
|
||
need to send either one of `workflow_id` or `task_id` | ||
|
||
# Response | ||
|
||
### If workflow_id is provided: | ||
|
||
returns dataset for all task_ids associated with the given workflow_id | ||
|
||
```json | ||
{ | ||
"workflow_id": "", | ||
"data": [ | ||
{ | ||
"task_id": "", | ||
"dataset": "MINIO LINK for the csv of a dataset" | ||
}, | ||
{ | ||
"task_id": "", | ||
"dataset": "MINIO LINK for the csv of a dataset" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### If task_id is provided | ||
|
||
dataset for just one task_id is provided | ||
|
||
```json | ||
{ | ||
"workflow_id": "", | ||
"data": [ | ||
{ | ||
"task_id": "", | ||
"dataset": "MINIO LINK for the csv of a dataset" | ||
} | ||
] | ||
} | ||
``` |
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,22 @@ | ||
# Endpoint | ||
|
||
/workflow-v2/generate/{workflow_id} | ||
|
||
# Request | ||
|
||
### Headers | ||
|
||
- User Auth | ||
|
||
# Response | ||
|
||
```json | ||
{ | ||
"expected_cost": "", | ||
"task_id": "" | ||
} | ||
``` | ||
|
||
## Implementation Details | ||
|
||
The prompt which goes to GPT will only include those examples which have been provided a reason. |
Oops, something went wrong.