contacts

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package contacts provides Google Contacts (People API) tools for agents. It enables listing and searching the user's contacts using the same embedded OAuth client as Calendar when built with -X (see pkg/tools/google/oauth).

Authentication: Same as Calendar — CredentialsFile (path or JSON) or build-time injected GoogleClientID/GoogleClientSecret. TokenFile (or inline token) required for OAuth2. Enable People API in Google Cloud Console.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service added in v0.1.7

type Service interface {
	ListContacts(ctx context.Context, req listContactsRequest) (contactsResponse, error)
	SearchContacts(ctx context.Context, req searchContactsRequest) (contactsResponse, error)
}

Service provides Google Contacts operations for tools.

func NewFromSecretProvider added in v0.1.7

func NewFromSecretProvider(ctx context.Context, secretProvider security.SecretProvider, name string) (Service, error)

NewFromSecretProvider creates an authenticated People API client using CredentialsFile + TokenFile from the secret provider, or embedded build-time credentials (see pkg/tools/google/oauth).

func NewLazyService added in v0.1.7

func NewLazyService(sp security.SecretProvider, name string) Service

NewLazyService returns a Service that lazily initialises the People API client on first use. The returned Service is safe for concurrent use.

type ToolProvider

type ToolProvider struct {
	// contains filtered or unexported fields
}

ToolProvider wraps the contacts tools and satisfies the tools.ToolProviders interface so contacts tools can be passed to tools.NewRegistry. Uses the same embedded OAuth client as Calendar when built with -X.

func NewToolProvider

func NewToolProvider(svc Service) *ToolProvider

NewToolProvider creates a ToolProvider for the contacts tools.

func (*ToolProvider) GetTools

func (p *ToolProvider) GetTools(name string) []tool.Tool

GetTools returns all contacts tools, prefixed with the given name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL