Problem with creating a prompt template function that calls a native function #10676
Unanswered
skarygia-te
asked this question in
Q&A
Replies: 1 comment
-
Tagging @alliscode |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I am trying to create a prompt template function that includes a call to a native function. The skprompt.txt file is looking like this:
prompt = """You are asked to retrieve information about a specific subject.
Infer the subject from the user {{$input}}.
Data: {{DataPlugin.get_data '24h'}}
Based on the data present to the user the ones that are relevant to the requested subject:
"""
Then I am attaching the template function and the plugin to a kernel using:
I am using python and the BedrockChatCompletion service for the kernel with auto function execution. The kernel is then used to create an agent.
When I am running the code the agent (when asked to retrieve information about sth) tries to run the template function "get_information_subject" but then either the DataPlugin.get_data function is run but the result is not embedded properly in the prompt, or it is not run at all and the LLM hallucinates an answer. Am I missing something? Is there sth wrong with my template or some parameter I need to set? Also, in the correct execution of the above function, am I supposed to see the function call to DataPlugin.get_data as a function call and result in the chat history or not?
Beta Was this translation helpful? Give feedback.
All reactions