Skip to content

sendMessageToCurrentConversation Fetch Function Not Returning Response #176

@neha-ajith

Description

@neha-ajith

We are currently integrating SQLChat with a locally hosted Ollama model. The request is successfully sent to the Ollama model, and the response is received as confirmed by the debug logs in the handler function. However, when debugging the sendMessageToCurrentConversation function in src/components/ConversationView/index.tsx, the fetch function does not return any response.

This is the response we get from the handler written in src\pages\api\chat.ts:

{"model":"llama3.1","created_at":"2025-02-24T11:32:42.5861613Z","message":{"role":"assistant","content":" CREATE TABLE \"employee\" (\n emp_id SERIAL PRIMARY KEY,\n name TEXT NOT NULL,\n email TEXT UNIQUE NOT NULL,\n job_title TEXT NOT NULL,\n hire_date DATE NOT NULL\n);"},"done_reason":"stop","done":true,"total_duration":18191938800,"load_duration":4233036600,"prompt_eval_count":336,"prompt_eval_duration":6012000000,"eval_count":44,"eval_duration":7394000000}

We debugged the handler function to catch any errors, but it was working fine. But even after receiving the response from ollama, we are still stuck at this:

Image

The response from the Ollama model seems to be correctly formatted and complete. However, it does not propagate back through the fetch function as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions