mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-20 07:04:20 +01:00
🏃 fix: run function
This commit is contained in:
@@ -77,7 +77,7 @@ class GPTSession:
|
||||
}]
|
||||
)
|
||||
break
|
||||
except RateLimitError:
|
||||
except (RateLimitError, openai.error.APIError):
|
||||
sleep(1)
|
||||
continue
|
||||
return True
|
||||
|
||||
@@ -11,5 +11,5 @@ class DevGPTExecutor(Executor):
|
||||
@jina_requests()
|
||||
def endpoint(self, docs: DocumentArray, **kwargs) -> DocumentArray:
|
||||
for d in docs:
|
||||
d.text = json.dumps(func(json.loads(d.text)))
|
||||
d.text = func(d.text)
|
||||
return docs
|
||||
|
||||
@@ -105,7 +105,7 @@ generated_string = gpt(prompt) # fill-in the prompt (str); the output is a stri
|
||||
template_generate_function = PromptTemplate.from_template(
|
||||
general_guidelines_string + '''
|
||||
|
||||
Write a python function which receives as input a dictionary and outputs a dictionary. The function is called 'func'.
|
||||
Write a python function which receives as input json string (that can be parsed with the python function json.loads) and outputs a json string (that can be parsed with the python function json.loads). The function is called 'func'.
|
||||
The function must full-fill: '{microservice_description}'.
|
||||
It will be tested with the following scenario: '{test_description}'.
|
||||
For the implementation use the following package(s): '{packages}'.
|
||||
|
||||
Reference in New Issue
Block a user