feat: add knowledge markdown formatting and detail retrieval
- Implemented KnowledgeWebsiteMarkdownPrompt for formatting webpage content into Markdown. - Added GetItemDetail method in KnowledgeHandler to retrieve knowledge item details. - Introduced KnowledgeDetailDrawer component for displaying knowledge item details in the admin web interface. - Created MarkdownPreview component for rendering Markdown content. - Added knowledge chunking and URL parsing logic to handle webpage content extraction and formatting. - Updated database schema to include markdown_content in knowledge_items table.
This commit is contained in:
@@ -113,6 +113,11 @@ func (c *arkClient) Generate(ctx context.Context, req GenerateRequest, onDelta f
|
||||
maxOutputTokens = req.MaxOutputTokens
|
||||
}
|
||||
|
||||
model := c.model
|
||||
if strings.TrimSpace(req.Model) != "" {
|
||||
model = strings.TrimSpace(req.Model)
|
||||
}
|
||||
|
||||
callCtx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
|
||||
@@ -154,7 +159,7 @@ func (c *arkClient) Generate(ctx context.Context, req GenerateRequest, onDelta f
|
||||
}
|
||||
|
||||
stream, err := c.client.CreateResponsesStream(callCtx, &responses.ResponsesRequest{
|
||||
Model: c.model,
|
||||
Model: model,
|
||||
MaxOutputTokens: &maxOutputTokens,
|
||||
Store: &store,
|
||||
Stream: &streamValue,
|
||||
@@ -232,7 +237,7 @@ func (c *arkClient) Generate(ctx context.Context, req GenerateRequest, onDelta f
|
||||
|
||||
return &GenerateResult{
|
||||
Content: result,
|
||||
Model: c.model,
|
||||
Model: model,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
var ErrNotConfigured = errors.New("llm provider is not configured")
|
||||
|
||||
type GenerateRequest struct {
|
||||
Model string
|
||||
Prompt string
|
||||
Timeout time.Duration
|
||||
MaxOutputTokens int64
|
||||
|
||||
Reference in New Issue
Block a user