Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions adk/middlewares/summarization/consts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright 2026 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package summarization

const (
extraKeyContentType = "_eino_summarization_content_type"
)

type summarizationContentType string

const (
contentTypeSummary summarizationContentType = "summary"
)

type ActionType string

const (
ActionTypeBeforeSummary ActionType = "before_summary"
ActionTypeAfterSummary ActionType = "after_summary"
)
44 changes: 44 additions & 0 deletions adk/middlewares/summarization/customized_action.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2026 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package summarization

import (
"github.com/cloudwego/eino/adk"
)

type CustomizedAction struct {
// Type is the action type.
Type ActionType `json:"type"`

// Before is set when Type is ActionTypeBeforeSummary.
// Emitted after trigger condition is met, before calling model to generate summary.
Before *BeforeSummaryAction `json:"before,omitempty"`

// After is set when Type is ActionTypeAfterSummary.
// Emitted after summary generation, before applying new messages to state.
After *AfterSummaryAction `json:"after,omitempty"`
}

type BeforeSummaryAction struct {
// Messages is the original state messages before summarization.
Messages []adk.Message `json:"messages,omitempty"`
}

type AfterSummaryAction struct {
// Messages is the final state messages after summarization.
Messages []adk.Message `json:"messages,omitempty"`
}
Loading