Telegram Group & Telegram Channel
👣 GoPilot

GoPilot — это библиотека для Go, которая позволяет вызывать ваши функции с помощью естественного языка.

⚡️ С её помощью можно:
- Анализировать запросы на естественном языке
- Автоматически выбирать нужную функцию
- Преобразовывать динамические параметры в строго типизированные структуры
- Проверять обязательные поля и валидировать входные данные
- Управлять порядком выполнения и ответами

## Ключевые особенности

- Natural Language Processing
Обработка запросов пользователя без ручного парсинга текста.
- Automatic Function Routing
GoPilot сам сопоставляет запрос с зарегистрированной функцией.
- Type-Safe Parameter Mapping
Динамические вводимые данные конвертируются в структуры Go.
- Built-in Validation
Генерируемая схема параметров учитывает теги required, description и др.
- Easy Integration
Простое API: регистрируете функции и задаёте системный промпт.
- Flexible Response Handling
Поддержка разных форматов ответа и «режимов» выполнения.

## Быстрый старт


import (
"context"
"github.com/SadikSunbul/gopilot"
"github.com/SadikSunbul/gopilot/clients"
"github.com/SadikSunbul/gopilot/pkg/generator"
)

type WeatherParams struct {
City string `json:"city" description:"City name" required:"true"`
}
type WeatherResponse struct {
City string `json:"city"`
Temp int `json:"temp"`
Condition string `json:"condition"`
}

func GetWeather(p WeatherParams) (WeatherResponse, error) {
return WeatherResponse{City: p.City, Temp: 25, Condition: "sunny"}, nil
}

func main() {
client, _ := clients.NewGeminiClient(context.Background(), "API_KEY", "gemini-2.0-flash")
gp, _ := gopilot.NewGopilot(client)

weatherFn := &gopilot.Function[WeatherParams, WeatherResponse]{
Name: "weather-agent",
Description: "Get weather by city",
Parameters: generator.GenerateParameterSchema(WeatherParams{}),
Execute: GetWeather,
}
gp.FunctionRegister(weatherFn)
gp.SetSystemPrompt(nil)

// Генерация + выполнение за один вызов
result, _ := gp.GenerateAndExecute("Какая погода в Москве?")
fmt.Printf("%+v\n", result)
}


Github

@golang_google
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/Golang_google/2886
Create:
Last Update:

👣 GoPilot

GoPilot — это библиотека для Go, которая позволяет вызывать ваши функции с помощью естественного языка.

⚡️ С её помощью можно:
- Анализировать запросы на естественном языке
- Автоматически выбирать нужную функцию
- Преобразовывать динамические параметры в строго типизированные структуры
- Проверять обязательные поля и валидировать входные данные
- Управлять порядком выполнения и ответами

## Ключевые особенности

- Natural Language Processing
Обработка запросов пользователя без ручного парсинга текста.
- Automatic Function Routing
GoPilot сам сопоставляет запрос с зарегистрированной функцией.
- Type-Safe Parameter Mapping
Динамические вводимые данные конвертируются в структуры Go.
- Built-in Validation
Генерируемая схема параметров учитывает теги required, description и др.
- Easy Integration
Простое API: регистрируете функции и задаёте системный промпт.
- Flexible Response Handling
Поддержка разных форматов ответа и «режимов» выполнения.

## Быстрый старт


import (
"context"
"github.com/SadikSunbul/gopilot"
"github.com/SadikSunbul/gopilot/clients"
"github.com/SadikSunbul/gopilot/pkg/generator"
)

type WeatherParams struct {
City string `json:"city" description:"City name" required:"true"`
}
type WeatherResponse struct {
City string `json:"city"`
Temp int `json:"temp"`
Condition string `json:"condition"`
}

func GetWeather(p WeatherParams) (WeatherResponse, error) {
return WeatherResponse{City: p.City, Temp: 25, Condition: "sunny"}, nil
}

func main() {
client, _ := clients.NewGeminiClient(context.Background(), "API_KEY", "gemini-2.0-flash")
gp, _ := gopilot.NewGopilot(client)

weatherFn := &gopilot.Function[WeatherParams, WeatherResponse]{
Name: "weather-agent",
Description: "Get weather by city",
Parameters: generator.GenerateParameterSchema(WeatherParams{}),
Execute: GetWeather,
}
gp.FunctionRegister(weatherFn)
gp.SetSystemPrompt(nil)

// Генерация + выполнение за один вызов
result, _ := gp.GenerateAndExecute("Какая погода в Москве?")
fmt.Printf("%+v\n", result)
}


Github

@golang_google

BY Golang




Share with your friend now:
tg-me.com/Golang_google/2886

View MORE
Open in Telegram


Golang Telegram | DID YOU KNOW?

Date: |

The lead from Wall Street offers little clarity as the major averages opened lower on Friday and then bounced back and forth across the unchanged line, finally finishing mixed and little changed.The Dow added 33.18 points or 0.10 percent to finish at 34,798.00, while the NASDAQ eased 4.54 points or 0.03 percent to close at 15,047.70 and the S&P 500 rose 6.50 points or 0.15 percent to end at 4,455.48. For the week, the Dow rose 0.6 percent, the NASDAQ added 0.1 percent and the S&P gained 0.5 percent.The lackluster performance on Wall Street came on uncertainty about the outlook for the markets following recent volatility.

The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.

Golang from kr


Telegram Golang
FROM USA