Closed behrica closed 1 year ago
Log output:
2023-09-09T14:56:15.842Z nixos INFO [bosquet.llm.openai:70] - Calling OAI with:
2023-09-09T14:56:15.843Z nixos INFO [bosquet.llm.openai:71] - Params: '{:model "text-davinci-003", :temperature 0.2, :max_tokens 250, :presence_penalty 0.4, :frequency_penalty 0.2, :n 1, :top_p 1}'
2023-09-09T14:56:15.844Z nixos INFO [bosquet.llm.openai:72] - Config: '{:impl :openai, :api-endpoint "https://api.openai.com/v1"}'
I think I do the same as this code example: https://github.com/zmedelis/bosquet#generation
From my debuugin it seems that it fails in this line allreday: https://github.com/zmedelis/bosquet/blob/95d410ae5db8e0b5d544b9f79e6cafabf9f01b7a/src/bosquet/complete.clj#L23
It does not take the passed in options into account to construct the llm record.
Even if this syntax would work:
(bg/complete-template template
...
{:play :llm/azure})
how should we be able to configure the options for "llm/azure" ?
The issue applies to complete-template
only.
generate
does work with Azure.
I do not have MS Azure account (tried going through the OAI application form and it requires a company email etc).
Is this still the case with v.0.3.7
? If you go to bosquet.llm.generator
comment section at the bottom, and change config to point to Azure service like that
(complete-template
"You are a playwright. Given the play's title and it's genre write a synopsis for that play.
Title: {{title}}
Genre: {{genre}}
Playwright: This is a synopsis for the above play: {% gen var-name=text %}"
{:title "Mr. X" :genre "crime"}
{:text {:bosquet.llm/service [:llm/openai :provider/azure]
:bosquet.llm/model-parameters {:temperature 0 :model "gpt-4"}}})
Does it work? For both complete-template
and generate
?
yes, both work. We can close the issue.
Using this in v 0.3.6
config.edn
I am not able to switch to use azure open AI. I get exception on missing/wrong OpenAI key.
I debugged this intensively but could not figure out, if my configuration or teh code is teh problem.