(message as text ) as text => let url = "https://api.openai.com/v1/chat/completions", apikey = "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" , headers = [ #"Content-Type" = "application/json", #"Authorization" = "Bearer " & apikey ], body = Json.FromValue([ model = "gpt-3.5-turbo", messages = [{[role="user", content=message]}] ]), response = Web.Contents(url, [Headers=headers, Content=body]), content = Json.Document(response)[choices]{0}[message][content] in content
I have used this query to integrate the chat gpt in power bi but when i am invoking the function in power bi i is giving me credentials error.
Can any body know the solution for the same
I have used this query to integrate the chat gpt in power bi but when i am invoking the function in power bi i is giving me credentials error.
Can any body know the solution for the same