logoalt Hacker News

toygyesterday at 4:23 PM2 repliesview on HN

Is there some sort of dedicated tool for this type of setup, or did you hand-craft it ?


Replies

jermaustin1yesterday at 6:01 PM

Somewhat hand rolled, somewhat claude coded.

Back in 2023 I started my own C# LLM library for doing tool calls and structured output, and over the years it has morphed bigger and bigger, and that is the backbone of almost all of my LLM-based projects.

I've never released it, but its easy to understand, and simple to add your own tools:

  [AIDescription("Get current weather for a location")]
  static string GetWeather(
    [AIDescription("The city name")] string city,
    [AIDescription("The country name")] string country,
    [AIDescription("Temperature unit", ["C", "F"])] string unit = "C")
  {
    // make some API call to a weather API and return a string to the LLM
    return $"The weather in {city}, {country} is 22°{unit} and sunny";
  }
  
  var chat = client.StartConversation("You are a helpful assistant with access to weather data.");
  var response = await chat.SendAsync<string>("What's the weather in London?", GetWeather);
I'm sure plenty of better libraries exist for this now, but in 2023, I don't think any existed in the dotnet ecosystem. I've never released it though, because I've never "finished" it.
show 1 reply
seanmcdirmidyesterday at 4:25 PM

Not parent, but I use Goose for my non-handcrafted Qwen use cases, I’m also working on handcrafting as well. Goose was the only harness that didnt bloat context too much with system prompts (like openclaw) and I could get reasonable web search working with Qwen.