Slyv.Goals.OpenAI (1.0.0)

Published 2026-01-06 19:54:15 +00:00 by logikonline

Installation

dotnet nuget add source --name logikonline --username your_username --password your_token 
dotnet add package --source logikonline --version 1.0.0 Slyv.Goals.OpenAI

About this package

OpenAI integration for Slyv.Goals - provides AI-powered goal drafting using GPT-4 function calling and mindset transformation capabilities. Optional package for users who want LLM-enhanced goal creation.

Slyv.Goals.OpenAI

OpenAI integration for the Slyv.Goals library, providing AI-powered goal drafting using GPT-4 function calling.

Features

  • AI Goal Drafting: Convert natural language goal descriptions into structured goal plans with milestones and steps
  • Mindset Transformation: Transform fixed mindset language into growth mindset alternatives
  • Function Calling: Uses OpenAI's function calling for reliable, structured output
  • Cultural Awareness: Works with any language input for truly global goal management

Installation

dotnet add package Slyv.Goals.OpenAI

Usage

Basic Setup

// In your Program.cs or Startup.cs
services.AddSlyvGoals(); // Add core goal services
services.AddSlyvGoalsOpenAI(
    apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")!,
    model: "gpt-4o" // Optional, defaults to gpt-4o
);

Using Configuration

services.AddSlyvGoalsOpenAI(options =>
{
    options.ApiKey = configuration["OpenAI:ApiKey"]!;
    options.Model = "gpt-4o";
    options.MaxTokens = 2000;
    options.Temperature = 0.7;
});

Direct Usage

var draftingService = serviceProvider.GetRequiredService<IGoalDraftingService>();

// Draft a goal from natural language
var plan = await draftingService.DraftGoalFromTextAsync(
    "Run a half-marathon next April and lose 10 lbs safely",
    userContext: "Male, 52; runs 10-12 miles/week"
);

// Transform mindset
var transformed = await draftingService.TransformMindsetAsync(
    "I can't do this, I'll never be good at running"
);

Requirements

  • .NET 8.0 or later
  • OpenAI API key with access to GPT-4

Dependencies

  • Slyv.Goals (core goal management)
  • OpenAI SDK (official .NET SDK)

License

MIT License - see LICENSE file for details.

Initial release of OpenAI integration for Slyv.Goals.

Dependencies

ID Version Target Framework
Slyv.Goals 1.0.0 net9.0
Microsoft.Extensions.DependencyInjection.Abstractions 9.0.10 net9.0
Microsoft.Extensions.Options 9.0.10 net9.0
OpenAI 2.5.0 net9.0
Details
NuGet
2026-01-06 19:54:15 +00:00
0
David H. Friedel Jr.
41 KiB
Assets (4)
Versions (1) View all
1.0.0 2026-01-06