38 lines
815 B
Go
38 lines
815 B
Go
|
|
package toolhost
|
||
|
|
|
||
|
|
import "encoding/json"
|
||
|
|
|
||
|
|
type rpcRequest struct {
|
||
|
|
JSONRPC string `json:"jsonrpc"`
|
||
|
|
ID int64 `json:"id"`
|
||
|
|
Method string `json:"method"`
|
||
|
|
Params json.RawMessage `json:"params,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type rpcResponse struct {
|
||
|
|
JSONRPC string `json:"jsonrpc"`
|
||
|
|
ID int64 `json:"id"`
|
||
|
|
Result interface{} `json:"result,omitempty"`
|
||
|
|
Error *rpcError `json:"error,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type rpcError struct {
|
||
|
|
Code int `json:"code"`
|
||
|
|
Message string `json:"message"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type toolInfo struct {
|
||
|
|
Name string `json:"name"`
|
||
|
|
Description string `json:"description"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type toolCallParams struct {
|
||
|
|
Name string `json:"name"`
|
||
|
|
Input string `json:"input"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type toolCallResult struct {
|
||
|
|
Output string `json:"output"`
|
||
|
|
Error string `json:"error,omitempty"`
|
||
|
|
}
|