mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2026-01-07 15:44:24 +01:00
refactor: for the playground we need jina requirements should be not so strict
This commit is contained in:
@@ -47,7 +47,7 @@ We are working on a way to use gpt-3.5-turbo as well.
|
||||
|
||||
### Create Microservice
|
||||
```bash
|
||||
gptdeploy create --description "Given a PDF, return it's text" --test "https://www.africau.edu/images/default/sample.pdf"
|
||||
gptdeploy create --description "Given a PDF, return its text" --test "https://www.africau.edu/images/default/sample.pdf"
|
||||
```
|
||||
To create your personal microservice two things are required:
|
||||
- A `description` of the task you want to accomplish.
|
||||
@@ -445,6 +445,10 @@ Make sure it is only printed twice in case it changed.
|
||||
- [ ] section for microservices built by the community
|
||||
- [ ] test feedback for playground generation (could be part of the debugging)
|
||||
- [ ] should we send everything via json in the text attribute for simplicity?
|
||||
- [ ] fix release workflow
|
||||
-
|
||||
|
||||
Proposal:
|
||||
- [ ] just generate the non-jina related code and insert it into an executor template
|
||||
- [ ] think about strategies after the first approach failed?
|
||||
- [ ] smooth rendering animation of the responses
|
||||
@@ -1,6 +1,7 @@
|
||||
click==8.1.3
|
||||
streamlit==1.21.0
|
||||
openai==0.27.4
|
||||
psutil==5.9.4
|
||||
jcloud==0.2.6
|
||||
jina-hubble-sdk==0.35.0
|
||||
click
|
||||
streamlit
|
||||
openai
|
||||
psutil
|
||||
jina
|
||||
jcloud
|
||||
jina-hubble-sdk
|
||||
@@ -292,14 +292,15 @@ package2,package3,...
|
||||
host = jina_cloud.deploy_flow(executor_name, executor_path)
|
||||
self.create_playground(executor_name, executor_path, host)
|
||||
except self.MaxDebugTimeReachedException:
|
||||
print('Could not debug the executor.')
|
||||
print('Could not debug the Executor.')
|
||||
continue
|
||||
print(f'''
|
||||
Executor name: {executor_name}
|
||||
Executor path: {executor_path}
|
||||
Host: {host}
|
||||
|
||||
Playground: streamlit run {os.path.join(executor_path, "app.py")}
|
||||
Run the following command to start the playground:
|
||||
streamlit run {os.path.join(executor_path, "app.py")}
|
||||
'''
|
||||
)
|
||||
break
|
||||
|
||||
@@ -89,7 +89,7 @@ class _GPTConversation:
|
||||
delta = chunk['choices'][0]['delta']
|
||||
if 'content' in delta:
|
||||
content = delta['content']
|
||||
print_colored('' if complete_string else 'assistent', content, 'green', end='')
|
||||
print_colored('' if complete_string else 'assistant', content, 'green', end='')
|
||||
complete_string += content
|
||||
return complete_string
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class MyInfoExecutor(Executor):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__()
|
||||
|
||||
@requests() # each executor must have exactly this decorator without parameters
|
||||
@requests() # each Executor must have exactly this decorator without parameters
|
||||
def foo(self, docs: DocumentArray, **kwargs) => DocumentArray:
|
||||
for d in docs:
|
||||
content = json.loads(d.text)
|
||||
@@ -22,7 +22,7 @@ class MyInfoExecutor(Executor):
|
||||
return docs
|
||||
```
|
||||
|
||||
An executor gets a DocumentArray as input and returns a DocumentArray as output.
|
||||
An Executor gets a DocumentArray as input and returns a DocumentArray as output.
|
||||
'''
|
||||
|
||||
docarray_example = f'''
|
||||
|
||||
@@ -9,7 +9,7 @@ def general_guidelines():
|
||||
"Every file starts with comments describing what the code is doing before the first import. "
|
||||
"Comments can only be written within code blocks. "
|
||||
"Then all imports are listed. "
|
||||
"It is important to import all modules that could be needed in the executor code. "
|
||||
"It is important to import all modules that could be needed in the Executor code. "
|
||||
"Always import: "
|
||||
"from jina import Executor, DocumentArray, Document, requests "
|
||||
"Start from top-level and then fully implement all methods. "
|
||||
|
||||
Reference in New Issue
Block a user