Releases: awaescher/OllamaSharp
Release 5.1.3
Release 5.1.2
- Improved tool usage with source generators #171 (preview)
Note
This is a preview feature. See #171 for more details.
All that's required to use tools with OllamaSharp is decorating static methods with the [OllamaTool]
attribute. OllamaSharp will automatically generate the required code that describes the tool's metadata and invokes the method automatically if requested by the LLM.
It's highly recommended to write a complete summary including the arguments as the summary is used to describe the method and its arguments to the LLM.
/// <summary>
/// Gets the current weather for a given location.
/// </summary>
/// <param name="location">The location or city to get the weather for</param>
/// <param name="unit">The unit to measure the temperature in</param>
/// <returns>The weather for the given location</returns>
[OllamaTool]
public static string GetWeather(string location, Unit unit) => $"It's cold at only 6° {unit} in {location}.";
You can find the generated code for the tools under the Dependencies node in your project:
Release 5.1.1
- Improved tool usage with source generators #171 (preview)
Note
This is a preview feature. See #171 for more details.
All that's required to use tools with OllamaSharp is decorating static methods with the [OllamaTool]
attribute. OllamaSharp will automatically generate the required code that describes the tool's metadata and invokes the method automatically if requested by the LLM.
It's highly recommended to write a complete summary including the arguments as the summary is used to describe the method and its arguments to the LLM.
/// <summary>
/// Gets the current weather for a given location.
/// </summary>
/// <param name="location">The location or city to get the weather for</param>
/// <param name="unit">The unit to measure the temperature in</param>
/// <returns>The weather for the given location</returns>
[OllamaTool]
public static string GetWeather(string location, Unit unit) => $"It's cold at only 6° {unit} in {location}.";
You can find the generated code for the tools under the Dependencies node in your project:
Release 5.1.0
- Improved tool usage with source generators #171 (preview)
Note
This is a preview feature. See #171 for more details.
All that's required to use tools with OllamaSharp is decorating static methods with the [OllamaTool]
attribute. OllamaSharp will automatically generate the required code that describes the tool's metadata and invokes the method automatically if requested by the LLM.
It's highly recommended to write a complete summary including the arguments as the summary is used to describe the method and its arguments to the LLM.
/// <summary>
/// Gets the current weather for a given location.
/// </summary>
/// <param name="location">The location or city to get the weather for</param>
/// <param name="unit">The unit to measure the temperature in</param>
/// <returns>The weather for the given location</returns>
[OllamaTool]
public static string GetWeather(string location, Unit unit) => $"It's cold at only 6° {unit} in {location}.";
You can find the generated code for the tools under the Dependencies node in your project:
Release 5.0.7
Release 5.0.6
Release 5.0.5
- Added support for structured output when using Microsoft.Extensions.AI #180
Thanks @jmatthiesen and @stephentoub