mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-03 15:00:24 +00:00
add initial git support
This commit is contained in:
parent
0697dcc1d9
commit
bd2ec29b65
19 changed files with 791 additions and 176 deletions
|
|
@ -17,6 +17,9 @@ type toolResponseType string
|
|||
const (
|
||||
ToolResponseTypeText toolResponseType = "text"
|
||||
ToolResponseTypeImage toolResponseType = "image"
|
||||
|
||||
SessionIDContextKey = "session_id"
|
||||
MessageIDContextKey = "message_id"
|
||||
)
|
||||
|
||||
type ToolResponse struct {
|
||||
|
|
@ -62,3 +65,15 @@ type BaseTool interface {
|
|||
Info() ToolInfo
|
||||
Run(ctx context.Context, params ToolCall) (ToolResponse, error)
|
||||
}
|
||||
|
||||
func getContextValues(ctx context.Context) (string, string) {
|
||||
sessionID := ctx.Value(SessionIDContextKey)
|
||||
messageID := ctx.Value(MessageIDContextKey)
|
||||
if sessionID == nil {
|
||||
return "", ""
|
||||
}
|
||||
if messageID == nil {
|
||||
return sessionID.(string), ""
|
||||
}
|
||||
return sessionID.(string), messageID.(string)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue