docs: update AI module README with latest features

- Add comprehensive documentation for the new Query functionality
- Update interface method names from Call to Plan for consistency
- Add OpenAI GPT-4O model support documentation
- Include detailed usage examples for basic and custom schema queries
- Add configuration examples for multiple model services
- Document new features like ResetHistory, Usage statistics, and automatic type conversion
- Expand advanced features section with custom output format examples
- Update all code examples to reflect the latest API changes

The documentation now reflects the current state of the AI module with all three core capabilities:
- Planning (renamed from Call)
- Assertion
- Query (new feature)

All examples and configurations are updated to match the latest implementation.
This commit is contained in:
lilong.129
2025-06-10 20:52:44 +08:00
parent c513e56d30
commit 81a92ae155
7 changed files with 241 additions and 32 deletions
+4 -4
View File
@@ -9,7 +9,7 @@ import (
// ILLMService 定义了 LLM 服务接口,包括规划、断言和查询功能
type ILLMService interface {
Call(ctx context.Context, opts *PlanningOptions) (*PlanningResult, error)
Plan(ctx context.Context, opts *PlanningOptions) (*PlanningResult, error)
Assert(ctx context.Context, opts *AssertOptions) (*AssertionResult, error)
Query(ctx context.Context, opts *QueryOptions) (*QueryResult, error)
// RegisterTools registers tools for function calling
@@ -50,9 +50,9 @@ type combinedLLMService struct {
querier IQuerier // 提供查询功能
}
// Call 执行规划功能
func (c *combinedLLMService) Call(ctx context.Context, opts *PlanningOptions) (*PlanningResult, error) {
return c.planner.Call(ctx, opts)
// Plan 执行规划功能
func (c *combinedLLMService) Plan(ctx context.Context, opts *PlanningOptions) (*PlanningResult, error) {
return c.planner.Plan(ctx, opts)
}
// Assert 执行断言功能