Documentation
¶
Overview ¶
Package composio provides a composio client for pegwings-go.
Index ¶
- type AuthOption
- type Authorizer
- type Composio
- func (c *Composio) GetConnectedAccounts(ctx context.Context, opts ...AuthOption) ([]ConnectedAccount, error)
- func (c *Composio) GetTools(ctx context.Context, opts ...ToolsOption) ([]tools.Tool, error)
- func (c *Composio) Run(ctx context.Context, user ConnectedAccount, ...) ([]pegwings.ChatCompletionMessage, error)
- type ConnectedAccount
- type Integration
- type Option
- type Runner
- type Tool
- type ToolsOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthOption ¶
AuthOption is an option for the auth request.
func WithShowActiveOnly ¶
func WithShowActiveOnly(showActiveOnly bool) AuthOption
WithShowActiveOnly sets the show active only for the auth request.
func WithUserUUID ¶
func WithUserUUID(userUUID string) AuthOption
WithUserUUID sets the user uuid for the auth request.
type Authorizer ¶
type Authorizer interface {
GetConnectedAccounts(ctx context.Context, opts ...AuthOption) ([]ConnectedAccount, error)
}
Authorizer is an interface for composio auth.
type Composio ¶
type Composio struct {
// contains filtered or unexported fields
}
Composio is a composio client.
func NewComposer ¶
NewComposer creates a new composio client.
func (*Composio) GetConnectedAccounts ¶
func (c *Composio) GetConnectedAccounts( ctx context.Context, opts ...AuthOption, ) ([]ConnectedAccount, error)
GetConnectedAccounts returns the connected accounts for the composio client.
func (*Composio) Run ¶
func (c *Composio) Run( ctx context.Context, user ConnectedAccount, response pegwings.ChatCompletionResponse, ) ([]pegwings.ChatCompletionMessage, error)
Run runs the composio client on a chat completion response.
type ConnectedAccount ¶
type ConnectedAccount struct {
IntegrationID string `json:"integrationId"`
ConnectionParams struct {
Scope string `json:"scope"`
Scopes []string `json:"scopes"`
BaseURL string `json:"base_url"`
ClientID string `json:"client_id"`
TokenType string `json:"token_type"`
RedirectURL string `json:"redirectUrl"`
AccessToken string `json:"access_token"`
CallbackURL string `json:"callback_url"`
ClientSecret string `json:"client_secret"`
CodeVerifier string `json:"code_verifier"`
FinalRedirectURI string `json:"finalRedirectUri"`
} `json:"connectionParams"`
IsDisabled bool `json:"isDisabled"`
ID string `json:"id"`
MemberID string `json:"memberId"`
ClientUniqueUserID string `json:"clientUniqueUserId"`
Status string `json:"status"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Member struct {
ID string `json:"id"`
ClientID string `json:"clientId"`
Email string `json:"email"`
Name string `json:"name"`
Role string `json:"role"`
Metadata any `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt any `json:"deletedAt"`
} `json:"member"`
AppUniqueID string `json:"appUniqueId"`
AppName string `json:"appName"`
Logo string `json:"logo"`
IntegrationIsDisabled bool `json:"integrationIsDisabled"`
IntegrationDisabledReason string `json:"integrationDisabledReason"`
InvocationCount string `json:"invocationCount"`
}
ConnectedAccount represents a composio connected account.
Gotten from similar url to: https://backend.composio.dev/api/v1/connectedAccounts?user_uuid=default&showActiveOnly=true
type Integration ¶
Integration represents a composio integration.
type Option ¶
type Option func(*Composio)
Option is an option for the composio client.
WithLogger sets the logger for the composio client.
func WithBaseURL ¶
WithBaseURL sets the base URL for the composio client.
func WithLogger ¶
WithLogger sets the logger for the composio client.
type Runner ¶
type Runner interface {
Run(ctx context.Context,
user ConnectedAccount,
response pegwings.ChatCompletionResponse) (
[]pegwings.ChatCompletionMessage, error)
}
Runner is an interface for composio run.
type Tool ¶
type Tool struct {
// Name is the name of the tool returned by the composio api.
Name string `json:"name"`
// Enum is the enum of the tool returned by the composio api.
Enum string `json:"enum"`
// Tags are the tags of the tool returned by the composio api.
Tags []string `json:"tags"`
// Logo is the logo of the tool returned by the composio api.
Logo string `json:"logo"`
// AppID is the app id of the tool returned by the composio api.
AppID string `json:"appId"`
// AppName is the app name of the tool returned by the composio
// api.
AppName string `json:"appName"`
// DisplayName is the display name of the tool returned by the
// composio api.
DisplayName string `json:"displayName"`
// Description is the description of the tool returned by the
// composio api.
Description string `json:"description"`
// Parameters are the parameters of the tool returned by the
// composio api.
Parameters tools.FunctionParameters `json:"parameters"`
// Response is the response of the tool returned by the
// composio api.
Response struct {
// Properties are the properties of the response
// returned by the composio api.
Properties struct {
// Data is the data of the response returned by
// the composio api.
Data struct {
// Title is the title of the data in the
// response returned by the composio
// api.
Title string `json:"title"`
// Type is the type of the data in the
// response returned by the composio
// api.
Type string `json:"type"`
} `json:"data"`
// Successful is the successful response of the
// composio api.
Successful struct {
// Description is the description of the
// successful response of the composio
// api.
Description string `json:"description"`
// Title is the title of the successful
// response of the composio api.
Title string `json:"title"`
// Type is the type of the successful
// response of the composio api.
Type string `json:"type"`
} `json:"successful"`
Error struct {
AnyOf []struct {
Type string `json:"type"`
} `json:"anyOf"`
Default any `json:"default"`
Description string `json:"description"`
Title string `json:"title"`
} `json:"error"`
} `json:"properties"`
Required []string `json:"required"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"response"`
Deprecated bool `json:"deprecated"`
DisplayName0 string `json:"display_name"`
}
Tool represents a composio tool as returned by the api.
type ToolsOption ¶
ToolsOption is an option for the tools request.
func WithEntityID ¶
func WithEntityID(entityID string) ToolsOption
WithEntityID sets the entity id for the tools request.
func WithTags ¶
func WithTags(tags ...string) ToolsOption
WithTags sets the tags for the tools request.
func WithUseCase ¶
func WithUseCase(useCase string) ToolsOption
WithUseCase sets the use case for the tools request.