LangChain icon indicating copy to clipboard operation
LangChain copied to clipboard

Agent with Ollama can't find OllamaLanguageModelInstruction api.

Open acer1204 opened this issue 1 year ago • 2 comments

Describe the bug

after install this two package 1.LangChain.Core 2.LangChain.Providers.Ollama

copy the example code for ollama, but it's show OllamaLanguageModelInstruction and OllamaLanguageModelOptions not found.

Steps to reproduce the bug

1.install LangChain.Core 2.LangChain.Providers.Ollama 3.copy agent example for ollama

Expected behavior

it's can run

Screenshots

No response

NuGet package version

LangChain v0.15.0 LangChain.Core v0.15.0 LangChain.Providers.Ollama v0.15.0

Additional context

No response

acer1204 avatar Jul 01 '24 08:07 acer1204

Try use this

var provider = new OllamaProvider(
            "http://localhost:11434",
            options: new RequestOptions
            {
                Temperature = 0,
                Stop = new[] { "Observation", "[END]" }, // add injection word `Observation` and `[END]` to stop the model(just as additional safety feature)
            });
        var model = new OllamaChatModel(provider, id: "llama3").UseConsoleForDebug();

look like the wiki page is outdate and need to be update

quannv108 avatar Aug 08 '24 15:08 quannv108

Yes, it's best to use these tests as an example, we are in the process of migrating documentation from wiki to mkdocs https://github.com/tryAGI/LangChain/blob/main/src/Meta/test/WikiTests.AgentWithOllama.cs

HavenDV avatar Aug 08 '24 15:08 HavenDV

https://tryagi.github.io/LangChain/wiki/AgentWithOllama/

HavenDV avatar Aug 27 '24 08:08 HavenDV