-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to run Checking-internet-speed-with-Crew-and-Ollama #440
Comments
var model = new OllamaChatModel(new OllamaProvider(options: new RequestOptions edit the code var model = new OllamaChatModel(new OllamaProvider(options: new RequestOptions but I get another errors: Current Task: Assign task to one of my co-workers and return the result How can I to do? How to resoled the exception? |
Hello, World! Your personal goal is: assign task to one of your co-workers and return the result You have access to the following tools:
To use a tool, please use the exact following format: Thought: Do I need to use a tool? Yes When you have a response for your task, or if you do not need to use a tool, you MUST use the format: Thought: Do I need to use a tool? No Begin! This is VERY important to you, your job depends on it! Current Task: What is my ping to google's main dns server? Your personal goal is: checks the speed of internet connection You have access to the following tools:
To use a tool, please use the exact following format: Thought: Do I need to use a tool? Yes When you have a response for your task, or if you do not need to use a tool, you MUST use the format: Thought: Do I need to use a tool? No Begin! This is VERY important to you, your job depends on it! Current Task: What is the ping to google's main dns server? Your personal goal is: checks the speed of internet connection You have access to the following tools:
To use a tool, please use the exact following format: Thought: Do I need to use a tool? Yes When you have a response for your task, or if you do not need to use a tool, you MUST use the format: Thought: Do I need to use a tool? No Begin! This is VERY important to you, your job depends on it! Current Task: What is the ping to google's main dns server? Observation: 8.8.8.8 的 Ping 统计信息: Thought: Do I need to use a tool? No Your personal goal is: assign task to one of your co-workers and return the result You have access to the following tools:
To use a tool, please use the exact following format: Thought: Do I need to use a tool? Yes When you have a response for your task, or if you do not need to use a tool, you MUST use the format: Thought: Do I need to use a tool? No Begin! This is VERY important to you, your job depends on it! Current Task: What is my ping to google's main dns server? Observation: The average connection speed is 35 milliseconds. Current Task: Assign task to one of my co-workers and return the result Unhandled exception. LangChain.Chains.HelperChains.Exceptions.StackableChainException: Error occurred in ReActParserChain with inputs Current Task: Assign task to one of my co-workers and return the result . Current Task: Assign task to one of my co-workers and return the result at LangChain.Chains.StackableChains.ReAct.ReActParserChain.Parse(String text) in //src/Core/src/Chains/StackableChains/ReAct/ReActParserChain.cs:line 47 at Program.(String[] args) |
Describe the bug
https://github.com/tryAGI/LangChain/wiki/Checking-internet-speed-with-Crew-and-Ollama
I Change the code sample such as:
using System.Diagnostics;
using System.Net;
using LangChain.Chains.StackableChains.Agents.Crew;
using LangChain.Chains.StackableChains.Agents.Crew.Tools;
using LangChain.Providers;
using LangChain.Providers.Ollama;
using Ollama;
using static LangChain.Chains.Chain;
using static LangChain.Chains.StackableChains.Agents.Crew.CrewChain;
Console.WriteLine("Hello, World!");
//var model = new OllamaLanguageModelInstruction("mistral:latest",
// "http://localhost:11434",
// options: new OllamaLanguageModelOptions()
// {
// Stop = new[] { "Observation", "[END]" }, // add injection word
Observation
and[END]
to stop the model(just as additional safety feature)// Temperature = 0
// }).UseConsoleForDebug(); // we want to see what is going on
// 2. Create a model
var model = new OllamaChatModel(new OllamaProvider(options: new RequestOptions
{
Temperature = 0,
Stop = ["User:"],
}), "llama3.1:latest");
var pingTool = new CrewAgentToolLambda("ping", "executes ping on specified ip address", address =>
{
var addressParsed = IPAddress.Parse(address);
var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "ping",
Arguments = "-n 5 " + addressParsed,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
}
};
process.Start();
string result = process.StandardOutput.ReadToEnd();
process.WaitForExit();
return Task.FromResult(result);
});
// controls agents
var manager = new CrewAgent(model, "manager", "assign task to one of your co-workers and return the result");
// the actual agent who does the job
var pinger = new CrewAgent(model, "pinger", "checks the speed of internet connection",
"you using ping command and analyzing it's result. After this you print a single number as your final answer(the connection speed in milliseconds).");
pinger.AddTools(new[] { pingTool });
var chain =
Set("What is my ping to google's main dns server?")
| Crew(new[] { manager, pinger }, manager);
// get response and send it as AI answer
var res = await chain.RunAsync("text", CancellationToken.None);
Console.WriteLine(res);
I got nothing: res
Steps to reproduce the bug
run the sample code , get nothing.
Expected behavior
No response
Screenshots
NuGet package version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: