patterns-ai-core / langchainrb_rails

MIT License
204 stars 21 forks source link

Fix Model.ask response parsing #54

Closed mengqing closed 7 months ago

mengqing commented 8 months ago

use .chat_completion instead of .completion when parsing Model.ask as it uses the chat endpoint

Some of the LLM models have identical chat_completion and completion (eg: OpenAI), while others have different response structures returned from the API (eg: Ollama)

andreibondarev commented 7 months ago

@mengqing Nice fix, thank you!