cdodev
cdodev4w ago

AI completion

I'm getting an error with my AI set up: log:
Dec 11 14:45:36 drh windmill_server[22296]: 2024-12-11T14:45:36.421553Z ERROR request: windmill-common/src/error.rs:105: Bad request: invalid type: null, expected a string error=BadRequest("invalid type: null, expected a string") method=POST uri=/api/w/admins/ai/proxy/chat/completions traceId="b40e0287-7050-4df3-87bb-0aa1cca0e4d9" username="ben@missionctrl.dev" email="ben@missionctrl.dev" workspace_id="admins"
Dec 11 14:45:36 drh windmill_server[22296]: 2024-12-11T14:45:36.421553Z ERROR request: windmill-common/src/error.rs:105: Bad request: invalid type: null, expected a string error=BadRequest("invalid type: null, expected a string") method=POST uri=/api/w/admins/ai/proxy/chat/completions traceId="b40e0287-7050-4df3-87bb-0aa1cca0e4d9" username="ben@missionctrl.dev" email="ben@missionctrl.dev" workspace_id="admins"
I've verified that the openAI key that I added to the workspace is valid...
11 Replies
cdodev
cdodevOP4w ago
I've also verified that the same key works to make API calls to openAI from a windmill script.
rubenf
rubenf4w ago
Is that autocompletion OR script generation.
cdodev
cdodevOP4w ago
Script generation and autocompletion (and also when I press the test key button in the workspace ai settings screen). I've also added an anthropic key which is having the same problem... Invalid key: Error: 400 Bad request: invalid type: null, expected a string is the error I get in the popup on the client side
rubenf
rubenf4w ago
can you try reproducing on app.windmill.dev and share your workspace with us
cdodev
cdodevOP4w ago
Sure - give me a sec The anthropic key works fine on app.windmill.dev CE v1.437.1-2-g343cd02ad is my version for the set up
rubenf
rubenf4w ago
ask your db for:
SELECT ai_resource FROM workspace_settings
SELECT ai_resource FROM workspace_settings
cdodev
cdodevOP4w ago
windmill=# SELECT ai_resource FROM workspace_settings; ai_resource
---------------------------------------------------------- {"path": null, "provider": "openai"} {"path": "u/ben/drh_anthropic", "provider": "anthropic"}
windmill=# SELECT ai_resource, workspace_id FROM workspace_settings;
ai_resource | workspace_id
-----------------------------------------------------------------+--------------
{"path": null, "provider": "openai"} | admins
{"path": "u/ben/openai_windmill_codegen", "provider": "openai"} | drh
windmill=# SELECT ai_resource, workspace_id FROM workspace_settings;
ai_resource | workspace_id
-----------------------------------------------------------------+--------------
{"path": null, "provider": "openai"} | admins
{"path": "u/ben/openai_windmill_codegen", "provider": "openai"} | drh
(when I edit to enable openai for codegen drh is the workspace I'm looking at
rubenf
rubenf4w ago
investigating what's the content of: u/ben/openai_windmill_codegen
cdodev
cdodevOP4w ago
The variable has a valid openai key
No description
rubenf
rubenf4w ago
I can't reproduce at all what if you create a new resource ?
cdodev
cdodevOP4w ago
OK - let me try that (I did do that with the anthropic key). I'll delete them both and re add Weird - I restarted the server and worker service and it started working!

Did you find this page helpful?