tarasglek / chatcraft.org

Developer-oriented ChatGPT clone
https://chatcraft.org/
MIT License
150 stars 26 forks source link

Models format wrong for https://www.val.town/v/taras/free_open_router #515

Open humphd opened 5 months ago

humphd commented 5 months ago

The OpenAI client code can't parse the models response for https://platform.openai.com/docs/api-reference/models/list. @tarasglek can you fix it to match https://platform.openai.com/docs/api-reference/models/list? I think it's just missing "object": "list".

cc @kliu57

tarasglek commented 5 months ago

does openrouter have this @kliu57

tarasglek commented 5 months ago

@kliu57 can you describe the openai client error in more detail and what happens when it's pointed at openrouter? I'll file the bug with openrouter devs

tarasglek commented 5 months ago

(I verified that openrouter also doesn't return this response)

tarasglek commented 5 months ago

We might need to use a fetch() adapter to inject it on clientside, cos i bet most open source list endpoint wont work too

kliu57 commented 5 months ago

@tarasglek I was debugging this with Dave and Dave thinks it's due to the content type being wrong, everything else is the same as OpenRouter. Try to return JSON for the content type?