Skip to content

mp cannot initiate the chat  #2

Description

@Barbaratao

def chatbot_reply(input_text):
"""Chat with the agent through terminal."""
queue = mp.Queue()
process = mp.Process(
target=initiate_chat_with_agent,
args=(llm_config, input_text, queue),
)
process.start()
try:
# process.join(TIMEOUT+2)
messages = queue.get(timeout=TIMEOUT)
except Exception as e:
messages = [
str(e)
if len(str(e)) > 0
else "Invalid Request to OpenAI, please check your API keys."
]
finally:
try:
process.terminate()
except:
pass
return messages
When I run the code, it shows an error like below. Could you please help me fix this?>
exitcode = _main(fd, parent_sentinel)
self = reduction.pickle.load(from_parent)
AttributeError: Can't get attribute 'initiate_chat_with_agent' on <module 'main' (built-in)>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions