Skip to content

Commit

Permalink
fix: invoke llm
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 12, 2024
1 parent 1503492 commit 83f0876
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/core/dify_invocation/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dify_invocation

import (
"github.com/go-playground/validator/v10"
"github.com/langgenius/dify-plugin-daemon/internal/types/entities/model_entities"
"github.com/langgenius/dify-plugin-daemon/internal/types/entities/plugin_entities"
"github.com/langgenius/dify-plugin-daemon/internal/types/entities/requests"
"github.com/langgenius/dify-plugin-daemon/internal/types/validators"
Expand Down Expand Up @@ -32,10 +33,20 @@ const (
INVOKE_TYPE_UPLOAD_FILE InvokeType = "upload_file"
)

type InvokeLLMSchema struct {
CompletionParams map[string]any `json:"completion_params" validate:"omitempty"`
PromptMessages []model_entities.PromptMessage `json:"prompt_messages" validate:"omitempty"`
Tools []model_entities.PromptMessageTool `json:"tools" validate:"omitempty,dive"`
Stop []string `json:"stop" validate:"omitempty"`
Stream bool `json:"stream"`
}

type InvokeLLMRequest struct {
BaseInvokeDifyRequest
requests.BaseRequestInvokeModel
requests.InvokeLLMSchema
// requests.InvokeLLMSchema,
// TODO: as completion_params in requests.InvokeLLMSchema is "model_parameters", we declare another one here
InvokeLLMSchema
}

type InvokeTextEmbeddingRequest struct {
Expand Down

0 comments on commit 83f0876

Please sign in to comment.