fix: fix formatting of system message

This commit is contained in:
Joschka Braun
2023-04-14 12:29:00 +02:00
parent 72fcae579f
commit 5bf3f52234
2 changed files with 6 additions and 3 deletions

View File

@@ -93,9 +93,9 @@ class _GPTConversation:
if 'executor' in system_definition_examples:
system_message += f'\n{executor_example}'
if 'docarray' in system_definition_examples:
system_message += f'{docarray_example}'
system_message += f'\n{docarray_example}'
if 'client' in system_definition_examples:
system_message += f'{client_example}'
system_message += f'\n{client_example}'
self.prompt_list[0] = ('system', system_message)
def get_response_from_stream(self, response_generator):

View File

@@ -27,14 +27,16 @@ An Executor gets a DocumentArray as input and returns a DocumentArray as output.
docarray_example = f'''A DocumentArray is a python class that can be seen as a list of Documents.
A Document is a python class that represents a single document.
Here is the protobuf definition of a Document:
```
message DocumentProto {{
// used to store json data the executor gets and returns
string text = 1;
}}
```
Here are examples of how a DocumentArray can be defined:
```
from jina import DocumentArray, Document
import json
@@ -52,6 +54,7 @@ array_list = array.tolist()
d3 = Document(text=json.dumps(array_list))
d4 = Document()
d4.text = '{{"uri": "https://.../logo.png"}}'
```
'''