ollama / ollama-js

Ollama JavaScript library
https://ollama.ai
MIT License
1.56k stars 103 forks source link

incorrect type for ShowResponse #74

Closed mrdjohnson closed 2 months ago

mrdjohnson commented 2 months ago

based on what i'm seeing in my logs, and tests

ShowResponse should actually be :

interface ShowResponse {
    license: string;
    modelfile: string;
    template: string;
    details: ModelDetails
}

not sure if something changed on ollama's end after the 3.0 upgrade but this is also described here: https://github.com/ollama/ollama/blob/main/docs/api.md#response-16

BruceMacD commented 2 months ago

Thanks for opening the issue, this is fixed in https://github.com/ollama/ollama-js/commit/63dcfbb44d3b22d9a1ae4bb333f158dbd5a119d7, which will be in the next release.

mrdjohnson commented 2 months ago

Am I reading correctly that the ShowResponse now has a message list? @BruceMacD

BruceMacD commented 2 months ago

Yup, that was there before though. The problem was that I didn't have the details under the details field.

The messages in the ShowResponse can be used to see the message history saved into a Modelfile: https://github.com/ollama/ollama/blob/main/docs/modelfile.md#message

mrdjohnson commented 2 months ago

Can you test that's a real thing.....because it's not part of the API that I linked...I think messages should have been removed as part of the PR as well.

The goal should be to accurately represent the entire ShowResponse .... In my opinion

mrdjohnson commented 2 months ago

Or maybe it was added manually? 🤔