Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Nunjucks question - JMWE

Rafael Frasson September 27, 2024

 

 

Hello,

I am having difficulty creating a shared action that retrieves data from ChatGPT. Currently, it fetches data from its default knowledge base, but I want it to pull information from the custom knowledge base that I have created.

The code is written in Nunjucks, and I would appreciate support in using the parameter to achieve this.

{%- set payload = {
"model": "gpt-4o-mini",
"messages": [{"role": "system", "content": user_prompt }],
"temperature": 0.2
} -%}

{%- set response = "https://api.openai.com/v1/chat/completions" | callRest(
verb = "POST",
options = {
"auth": {
"bearer": apiKey
},
"headers": {
"Content-Type": "application/json"
}
},
body = payload
) -%}

{{{{ response.choices[0].message.content }}}}

How can i use file search chatgpt call?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 28, 2024
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 28, 2024

@John Funk unfortunately, I don't know anything about the ChatGPT API so I don't know how to specify the custom knowledge base. 

@Rafael Frasson  where are you having an issue? In finding out how to use the ChatGPT API it how to use it from JMWE?

Like Rafael Frasson likes this
Rafael Frasson September 29, 2024

How to use, i think ive done. My trouble is: how to force the open api call, search the answer in your knowledge base, created from files that i put it on. Now, with my script, the answer returned from chatgpt is based on it knowledge default, but the knowledge about my digital products, it does not know very well. I am using a jmwe shared action, then put te shared action return in a customized field.

After a workflow run, in a postaction, this trigger run.

Did i be clear?

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events