Documentation
¶
Overview ¶
Package tavus provides a Go client for the Tavus API.
Tavus is an AI video research company providing conversational video interfaces, video generation, and avatar management capabilities.
The client wraps the ogen-generated API client with a higher-level interface that handles authentication and provides convenient methods for common operations.
Quick Start ¶
client, err := tavus.NewClient(tavus.WithAPIKey("your-api-key"))
if err != nil {
log.Fatal(err)
}
// Create a conversation
conv, err := client.Conversations().Create(ctx, &api.CreateConversationRequest{
PalId: "pal-id",
FaceId: "face-id",
})
Environment Variables ¶
If no API key is provided, the client will look for TAVUS_API_KEY in the environment.
Index ¶
- Constants
- type Client
- func (c *Client) API() *api.Client
- func (c *Client) APIKey() string
- func (c *Client) BaseURL() string
- func (c *Client) Conversations() *ConversationsService
- func (c *Client) Deployments() *DeploymentsService
- func (c *Client) Documents() *DocumentsService
- func (c *Client) Faces() *FacesService
- func (c *Client) Guardrails() *GuardrailsService
- func (c *Client) Objectives() *ObjectivesService
- func (c *Client) Pals() *PalsService
- func (c *Client) Tools() *ToolsService
- func (c *Client) Videos() *VideosService
- func (c *Client) Voices() *VoicesService
- type ConversationsService
- func (s *ConversationsService) Create(ctx context.Context, req *api.CreateConversationRequest) (*api.CreateConversationResponse, error)
- func (s *ConversationsService) Delete(ctx context.Context, conversationID string) error
- func (s *ConversationsService) End(ctx context.Context, conversationID string) error
- func (s *ConversationsService) Get(ctx context.Context, conversationID string) (*api.Conversation, error)
- func (s *ConversationsService) List(ctx context.Context, params api.ListConversationsParams) (*api.ListConversationsResponse, error)
- type DeploymentsService
- func (s *DeploymentsService) Create(ctx context.Context, req *api.CreateDeploymentRequest) (*api.Deployment, error)
- func (s *DeploymentsService) Delete(ctx context.Context, deploymentID string) error
- func (s *DeploymentsService) Get(ctx context.Context, deploymentID string) (*api.Deployment, error)
- func (s *DeploymentsService) List(ctx context.Context, params api.ListDeploymentsParams) (*api.ListDeploymentsResponse, error)
- func (s *DeploymentsService) Update(ctx context.Context, deploymentID string, req *api.UpdateDeploymentRequest) (*api.Deployment, error)
- type DocumentsService
- func (s *DocumentsService) Create(ctx context.Context, req *api.CreateDocumentRequest) (*api.CreateDocumentResponse, error)
- func (s *DocumentsService) Delete(ctx context.Context, documentID string) error
- func (s *DocumentsService) Get(ctx context.Context, documentID string) (*api.Document, error)
- func (s *DocumentsService) List(ctx context.Context, params api.ListDocumentsParams) (*api.ListDocumentsResponse, error)
- func (s *DocumentsService) Update(ctx context.Context, documentID string, req *api.UpdateDocumentRequest) (*api.Document, error)
- type FacesService
- func (s *FacesService) Create(ctx context.Context, req *api.CreateFaceRequest) (*api.CreateFaceResponse, error)
- func (s *FacesService) Delete(ctx context.Context, faceID string) error
- func (s *FacesService) Get(ctx context.Context, faceID string) (*api.Face, error)
- func (s *FacesService) List(ctx context.Context, params api.ListFacesParams) (*api.ListFacesResponse, error)
- func (s *FacesService) Rename(ctx context.Context, faceID, name string) error
- type GuardrailsService
- func (s *GuardrailsService) Create(ctx context.Context, req *api.CreateGuardrailRequest) (*api.Guardrail, error)
- func (s *GuardrailsService) Delete(ctx context.Context, guardrailID string) error
- func (s *GuardrailsService) Get(ctx context.Context, guardrailID string) (*api.Guardrail, error)
- func (s *GuardrailsService) List(ctx context.Context, params api.ListGuardrailsParams) (*api.ListGuardrailsResponse, error)
- func (s *GuardrailsService) Update(ctx context.Context, guardrailID string, req *api.UpdateGuardrailRequest) (*api.Guardrail, error)
- type ObjectivesService
- func (s *ObjectivesService) Create(ctx context.Context, req *api.CreateObjectivesRequest) (*api.CreateObjectivesResponse, error)
- func (s *ObjectivesService) Delete(ctx context.Context, objectivesID string) error
- func (s *ObjectivesService) Get(ctx context.Context, objectivesID string) (*api.Objectives, error)
- func (s *ObjectivesService) List(ctx context.Context, params api.ListObjectivesParams) (*api.ListObjectivesResponse, error)
- func (s *ObjectivesService) Update(ctx context.Context, objectivesID string, req *api.UpdateObjectivesRequest) (*api.Objectives, error)
- type Option
- type PalsService
- func (s *PalsService) AttachTool(ctx context.Context, palID, toolID string) error
- func (s *PalsService) Create(ctx context.Context, req *api.CreatePalRequest) (*api.CreatePalResponse, error)
- func (s *PalsService) Delete(ctx context.Context, palID string) error
- func (s *PalsService) Get(ctx context.Context, palID string) (*api.Pal, error)
- func (s *PalsService) List(ctx context.Context, params api.ListPalsParams) (*api.ListPalsResponse, error)
- func (s *PalsService) Update(ctx context.Context, palID string, req *api.UpdatePalRequest) (*api.Pal, error)
- type ToolsService
- func (s *ToolsService) Create(ctx context.Context, req *api.CreateToolRequest) (*api.Tool, error)
- func (s *ToolsService) Delete(ctx context.Context, toolID string) error
- func (s *ToolsService) Get(ctx context.Context, toolID string) (*api.Tool, error)
- func (s *ToolsService) List(ctx context.Context, params api.ListToolsParams) (*api.ListToolsResponse, error)
- func (s *ToolsService) Update(ctx context.Context, toolID string, req *api.UpdateToolRequest) (*api.Tool, error)
- type VideosService
- func (s *VideosService) Create(ctx context.Context, req *api.CreateVideoRequest) (*api.CreateVideoResponse, error)
- func (s *VideosService) Delete(ctx context.Context, videoID string) error
- func (s *VideosService) Get(ctx context.Context, videoID string) (*api.Video, error)
- func (s *VideosService) List(ctx context.Context, params api.ListVideosParams) (*api.ListVideosResponse, error)
- func (s *VideosService) Rename(ctx context.Context, videoID, name string) error
- type VoicesService
Constants ¶
const DefaultBaseURL = "https://tavusapi.com"
DefaultBaseURL is the default Tavus API base URL.
const Version = "0.1.0"
Version is the SDK version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the main Tavus client for interacting with the API.
func (*Client) API ¶
API returns the underlying ogen-generated API client for advanced usage. Use this when you need access to API endpoints not covered by the high-level wrapper methods.
func (*Client) Conversations ¶
func (c *Client) Conversations() *ConversationsService
Conversations returns the conversations service for real-time video sessions.
func (*Client) Deployments ¶
func (c *Client) Deployments() *DeploymentsService
Deployments returns the deployments service for distribution channels.
func (*Client) Documents ¶
func (c *Client) Documents() *DocumentsService
Documents returns the documents service for knowledge base management.
func (*Client) Faces ¶
func (c *Client) Faces() *FacesService
Faces returns the faces service for visual identity management.
func (*Client) Guardrails ¶
func (c *Client) Guardrails() *GuardrailsService
Guardrails returns the guardrails service for behavioral boundaries.
func (*Client) Objectives ¶
func (c *Client) Objectives() *ObjectivesService
Objectives returns the objectives service for conversation goals.
func (*Client) Pals ¶
func (c *Client) Pals() *PalsService
Pals returns the PALs service for personality AI layer management.
func (*Client) Tools ¶
func (c *Client) Tools() *ToolsService
Tools returns the tools service for function calling management.
func (*Client) Videos ¶
func (c *Client) Videos() *VideosService
Videos returns the videos service for async video generation.
func (*Client) Voices ¶
func (c *Client) Voices() *VoicesService
Voices returns the voices service for stock voice listing.
type ConversationsService ¶
type ConversationsService struct {
// contains filtered or unexported fields
}
ConversationsService handles real-time conversation sessions.
func (*ConversationsService) Create ¶
func (s *ConversationsService) Create(ctx context.Context, req *api.CreateConversationRequest) (*api.CreateConversationResponse, error)
Create creates a new conversation session.
func (*ConversationsService) Delete ¶
func (s *ConversationsService) Delete(ctx context.Context, conversationID string) error
Delete deletes a conversation.
func (*ConversationsService) End ¶
func (s *ConversationsService) End(ctx context.Context, conversationID string) error
End gracefully ends an active conversation.
func (*ConversationsService) Get ¶
func (s *ConversationsService) Get(ctx context.Context, conversationID string) (*api.Conversation, error)
Get returns a specific conversation.
func (*ConversationsService) List ¶
func (s *ConversationsService) List(ctx context.Context, params api.ListConversationsParams) (*api.ListConversationsResponse, error)
List returns all conversations.
type DeploymentsService ¶
type DeploymentsService struct {
// contains filtered or unexported fields
}
DeploymentsService handles distribution channel management.
func (*DeploymentsService) Create ¶
func (s *DeploymentsService) Create(ctx context.Context, req *api.CreateDeploymentRequest) (*api.Deployment, error)
Create creates a new deployment.
func (*DeploymentsService) Delete ¶
func (s *DeploymentsService) Delete(ctx context.Context, deploymentID string) error
Delete deletes a deployment.
func (*DeploymentsService) Get ¶
func (s *DeploymentsService) Get(ctx context.Context, deploymentID string) (*api.Deployment, error)
Get returns a specific deployment.
func (*DeploymentsService) List ¶
func (s *DeploymentsService) List(ctx context.Context, params api.ListDeploymentsParams) (*api.ListDeploymentsResponse, error)
List returns all deployments.
func (*DeploymentsService) Update ¶
func (s *DeploymentsService) Update(ctx context.Context, deploymentID string, req *api.UpdateDeploymentRequest) (*api.Deployment, error)
Update updates a deployment.
type DocumentsService ¶
type DocumentsService struct {
// contains filtered or unexported fields
}
DocumentsService handles knowledge base document management.
func (*DocumentsService) Create ¶
func (s *DocumentsService) Create(ctx context.Context, req *api.CreateDocumentRequest) (*api.CreateDocumentResponse, error)
Create uploads a new document.
func (*DocumentsService) Delete ¶
func (s *DocumentsService) Delete(ctx context.Context, documentID string) error
Delete deletes a document.
func (*DocumentsService) List ¶
func (s *DocumentsService) List(ctx context.Context, params api.ListDocumentsParams) (*api.ListDocumentsResponse, error)
List returns all documents.
type FacesService ¶
type FacesService struct {
// contains filtered or unexported fields
}
FacesService handles face (visual identity) management.
func (*FacesService) Create ¶
func (s *FacesService) Create(ctx context.Context, req *api.CreateFaceRequest) (*api.CreateFaceResponse, error)
Create starts training a new face.
func (*FacesService) Delete ¶
func (s *FacesService) Delete(ctx context.Context, faceID string) error
Delete deletes a face.
func (*FacesService) List ¶
func (s *FacesService) List(ctx context.Context, params api.ListFacesParams) (*api.ListFacesResponse, error)
List returns all faces.
type GuardrailsService ¶
type GuardrailsService struct {
// contains filtered or unexported fields
}
GuardrailsService handles behavioral boundary management.
func (*GuardrailsService) Create ¶
func (s *GuardrailsService) Create(ctx context.Context, req *api.CreateGuardrailRequest) (*api.Guardrail, error)
Create creates a new guardrail.
func (*GuardrailsService) Delete ¶
func (s *GuardrailsService) Delete(ctx context.Context, guardrailID string) error
Delete deletes a guardrail.
func (*GuardrailsService) List ¶
func (s *GuardrailsService) List(ctx context.Context, params api.ListGuardrailsParams) (*api.ListGuardrailsResponse, error)
List returns all guardrails.
type ObjectivesService ¶
type ObjectivesService struct {
// contains filtered or unexported fields
}
ObjectivesService handles conversation goal management.
func (*ObjectivesService) Create ¶
func (s *ObjectivesService) Create(ctx context.Context, req *api.CreateObjectivesRequest) (*api.CreateObjectivesResponse, error)
Create creates new objectives.
func (*ObjectivesService) Delete ¶
func (s *ObjectivesService) Delete(ctx context.Context, objectivesID string) error
Delete deletes objectives.
func (*ObjectivesService) Get ¶
func (s *ObjectivesService) Get(ctx context.Context, objectivesID string) (*api.Objectives, error)
Get returns specific objectives.
func (*ObjectivesService) List ¶
func (s *ObjectivesService) List(ctx context.Context, params api.ListObjectivesParams) (*api.ListObjectivesResponse, error)
List returns all objectives.
func (*ObjectivesService) Update ¶
func (s *ObjectivesService) Update(ctx context.Context, objectivesID string, req *api.UpdateObjectivesRequest) (*api.Objectives, error)
Update updates objectives.
type Option ¶
type Option func(*clientOptions)
Option is a functional option for configuring the Client.
func WithAPIKey ¶
WithAPIKey sets the API key for authentication.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithTimeout ¶
WithTimeout sets the request timeout.
type PalsService ¶
type PalsService struct {
// contains filtered or unexported fields
}
PalsService handles PAL (Personality AI Layer) management.
func (*PalsService) AttachTool ¶
func (s *PalsService) AttachTool(ctx context.Context, palID, toolID string) error
AttachTool attaches a tool to a PAL.
func (*PalsService) Create ¶
func (s *PalsService) Create(ctx context.Context, req *api.CreatePalRequest) (*api.CreatePalResponse, error)
Create creates a new PAL.
func (*PalsService) Delete ¶
func (s *PalsService) Delete(ctx context.Context, palID string) error
Delete deletes a PAL.
func (*PalsService) List ¶
func (s *PalsService) List(ctx context.Context, params api.ListPalsParams) (*api.ListPalsResponse, error)
List returns all PALs.
type ToolsService ¶
type ToolsService struct {
// contains filtered or unexported fields
}
ToolsService handles function calling tool management.
func (*ToolsService) Create ¶
func (s *ToolsService) Create(ctx context.Context, req *api.CreateToolRequest) (*api.Tool, error)
Create creates a new tool.
func (*ToolsService) Delete ¶
func (s *ToolsService) Delete(ctx context.Context, toolID string) error
Delete deletes a tool.
func (*ToolsService) List ¶
func (s *ToolsService) List(ctx context.Context, params api.ListToolsParams) (*api.ListToolsResponse, error)
List returns all tools.
type VideosService ¶
type VideosService struct {
// contains filtered or unexported fields
}
VideosService handles async video generation.
func (*VideosService) Create ¶
func (s *VideosService) Create(ctx context.Context, req *api.CreateVideoRequest) (*api.CreateVideoResponse, error)
Create starts generating a new video.
func (*VideosService) Delete ¶
func (s *VideosService) Delete(ctx context.Context, videoID string) error
Delete deletes a video.
func (*VideosService) List ¶
func (s *VideosService) List(ctx context.Context, params api.ListVideosParams) (*api.ListVideosResponse, error)
List returns all videos.
type VoicesService ¶
type VoicesService struct {
// contains filtered or unexported fields
}
VoicesService handles stock voice listing.
func (*VoicesService) List ¶
func (s *VoicesService) List(ctx context.Context, params api.ListVoicesParams) (*api.ListVoicesResponse, error)
List returns available stock voices.
Directories
¶
| Path | Synopsis |
|---|---|
|
Code generated by ogen, DO NOT EDIT.
|
Code generated by ogen, DO NOT EDIT. |
|
examples
|
|
|
basic
command
Example: Basic conversation creation and management
|
Example: Basic conversation creation and management |
|
custom-llm
command
Example: Custom LLM backend integration
|
Example: Custom LLM backend integration |
|
custom-llm-server
command
Example: Custom LLM Server (OpenAI-compatible)
|
Example: Custom LLM Server (OpenAI-compatible) |
|
list-resources
command
Example: List all Tavus resources
|
Example: List all Tavus resources |
|
pal-management
command
Example: PAL (Personality AI Layer) management
|
Example: PAL (Personality AI Layer) management |
|
tool-calling
command
Example: Tool calling with PALs
|
Example: Tool calling with PALs |