mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-21 01:31:06 +01:00
Added functionality to add to_message parameter to a function call to convert objects to strings in a custom way
This commit is contained in:
@@ -54,7 +54,9 @@ class AgentConvo:
|
||||
# TODO remove this once the database is set up properly
|
||||
message_content = response[0] if type(response) == tuple else response
|
||||
if isinstance(message_content, list):
|
||||
if len(message_content) > 0 and isinstance(message_content[0], dict):
|
||||
if 'to_message' in function_calls:
|
||||
string_response = function_calls['to_message'](message_content)
|
||||
elif len(message_content) > 0 and isinstance(message_content[0], dict):
|
||||
string_response = [
|
||||
f'#{i}\n' + array_of_objects_to_string(d)
|
||||
for i, d in enumerate(message_content)
|
||||
|
||||
Reference in New Issue
Block a user