The rest of the code is here: Write.Html.pq
// aliases
Write.Format = String.Write.Format,
Write.Element = Write.Html.Element,
Write.Key = Write.Html.KeyValue,
Tag = Write.Html.Element,
P = Write.Html.Paragraph,
B = Write.Html.Bold,
UL = Write.Html.UnorderedList,
This is what I wanted
NewVersion = StringBuilder.JoinParagraph({
"MCopilot",
UL({
Write.Key( "Creator", "Oscar Martinez." ),
Write.Key( "LinkedIn", "https://www.linkedin.com/in/oscarmartinezv/." ),
Write.Key( "Web", "bibb.pro" )
}),
"This function, interacts with the OpenAI API to provide responses based on given prompts. It serves as a tool for generating meaningful explanations and full code related to Power Query.",
"The function takes three parameters:",
UL({
Write.Key( "apiKey", "This is the Open API Key required for authentication." ),
Write.Key( "model", "This is the GPT chosen model." ),
Write.Key( "prompt", "This is the prompt provided to the function, requesting information or code related to Power Query." )
}),
"The function, constructs a request to the OpenAI API endpoint https://api.openai.com/v1/chat/completions.",
"The request body includes a system message indicating the role of the responder, as well as the user's prompt. The API key is included in the request headers for authentication.",
"Upon receiving the response from the API, the function extracts the content of the response message and returns it as the output."
}),
Original = "
<p><b>MCopilot</b></p>
<li><b>Creator: </b>Oscar Martinez.</li>
<li><b>LinkedIn:</b> https://www.linkedin.com/in/oscarmartinezv/.</li>
<li><b>Web: </b>bibb.pro</li>
<p>This function, interacts with the OpenAI API to provide responses based on given prompts. It serves as a tool for generating meaningful explanations and full code related to Power Query.</p>
<p>The function takes three parameters:</p>
<ul>
<li><b>apiKey:</b> This is the Open API Key required for authentication.</li>
<li><b>model:</b> This is the GPT chosen model.</li>
<li><b>prompt:</b> This is the prompt provided to the function, requesting information or code related to Power Query.</li>
</ul>
<p>The function, constructs a request to the OpenAI API endpoint <code>https://api.openai.com/v1/chat/completions</code>.</p>
<p>The request body includes a system message indicating the role of the responder, as well as the user's prompt. The API key is included in the request headers for authentication.</p>
<p>Upon receiving the response from the API, the function extracts the content of the response message and returns it as the output.</p>
",
This is what copilot wrote, using my functions:
first_pass_from_copilot_to_my_lib = StringBuilder.Join({
P( B("MCopilot") ),
UL({
B("Creator: ") & "Oscar Martinez.",
B("LinkedIn:") & "https://www.linkedin.com/in/oscarmartinezv/.",
B("Web: ") & "bibb.pro"
}),
P("This function, interacts with the OpenAI API to provide responses based on given prompts. It serves as a tool for generating meaningful explanations and full code related to Power Query."),
P("The function takes three parameters:"),
UL({
B("apiKey:") & "This is the Open API Key required for authentication.",
B("model:") & "This is the GPT chosen model.",
B("prompt:") & "This is the prompt provided to the function, requesting information or code related to Power Query."
}),
P("The function, constructs a request to the OpenAI API endpoint <code>https://api.openai.com/v1/chat/completions</code>."),
P("The request body includes a system message indicating the role of the responder, as well as the user's prompt. The API key is included in the request headers for authentication."),
P("Upon receiving the response from the API, the function extracts the content of the response message and returns it as the output.")
}),