coinbase_agentkit.action_providers.hyperboliclabs.ai package¶
Submodules¶
coinbase_agentkit.action_providers.hyperboliclabs.ai.action_provider module¶
Hyperbolic AI action provider.
This module provides actions for interacting with Hyperbolic AI services. It includes functionality for text, image and audio generation.
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.action_provider.AIActionProvider(api_key=None)¶
Bases:
ActionProvider
Action provider for generating text, images and audio via AI.
- description = 'Action provider for generating text, images and audio via AI.'¶
- generate_audio(args)¶
Generate audio from text using specified language and speaker.
- Parameters:
args (dict[str, Any]) – Input arguments for the action.
- Returns:
A message containing the action response or error details.
- Return type:
str
- generate_image(args)¶
Generate images using specified model.
- Parameters:
args (dict[str, Any]) – Input arguments for the action.
- Returns:
A message containing the action response or error details.
- Return type:
str
- generate_text(args)¶
Generate text using specified language model.
- Parameters:
args (dict[str, Any]) – Input arguments for the action.
- Returns:
A message containing the action response or error details.
- Return type:
str
- coinbase_agentkit.action_providers.hyperboliclabs.ai.action_provider.ai_action_provider(api_key=None)¶
Create a new instance of the AIActionProvider.
- Parameters:
api_key (
Optional
[str
]) – Optional API key for authentication. If not provided, will attempt to read from HYPERBOLIC_API_KEY environment variable.- Return type:
- Returns:
A new AI action provider instance.
- Raises:
ValueError – If API key is not provided and not found in environment.
coinbase_agentkit.action_providers.hyperboliclabs.ai.schemas module¶
Schemas for Hyperbolic AI actions.
This module provides simplified schemas for AI action inputs.
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.schemas.GenerateAudioSchema(**data)¶
Bases:
BaseModel
Schema for generate_audio action.
-
language:
str
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
speaker:
str
¶
-
speed:
float
|None
¶
-
text:
str
¶
-
language:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.schemas.GenerateImageSchema(**data)¶
Bases:
BaseModel
Schema for generate_image action.
-
height:
int
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
model_name:
str
¶
-
negative_prompt:
str
|None
¶
-
num_images:
int
¶
-
prompt:
str
¶
-
steps:
int
¶
-
width:
int
¶
-
height:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.schemas.GenerateTextSchema(**data)¶
Bases:
BaseModel
Schema for generate_text action.
-
model:
str
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
prompt:
str
¶
-
system_prompt:
str
|None
¶
-
model:
coinbase_agentkit.action_providers.hyperboliclabs.ai.service module¶
Service for AI-related operations.
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.service.AIService(api_key)¶
Bases:
Base
AI service for Hyperbolic platform.
- generate_audio(request)¶
Generate audio using specified model.
- Parameters:
request (
AudioGenerationRequest
) – The AudioGenerationRequest object containing the request parameters.- Returns:
The audio generation response.
- Return type:
- generate_image(request)¶
Generate images using specified model.
- Parameters:
request (
ImageGenerationRequest
) – The ImageGenerationRequest object containing the request parameters.- Returns:
The image generation response.
- Return type:
- generate_text(request)¶
Generate text using specified model.
- Parameters:
request (
ChatCompletionRequest
) – The ChatCompletionRequest object containing the request parameters.- Returns:
The chat completion response.
- Return type:
coinbase_agentkit.action_providers.hyperboliclabs.ai.types module¶
Types for Hyperbolic AI services.
This module provides type definitions for AI API communication.
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.AudioGenerationRequest(**data)¶
Bases:
BaseModel
Request model for audio generation API.
-
language:
str
|None
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
noise_scale:
float
|None
¶
-
noise_scale_w:
float
|None
¶
-
sdp_ratio:
float
|None
¶
-
speaker:
str
|None
¶
-
speed:
float
|None
¶
-
text:
str
¶
- classmethod validate_language(v)¶
Wrap a classmethod, staticmethod, property or unbound function and act as a descriptor that allows us to detect decorated items from the class’ attributes.
This class’ __get__ returns the wrapped item’s __get__ result, which makes it transparent for classmethods and staticmethods.
- wrapped¶
The decorator that has to be wrapped.
- decorator_info¶
The decorator info.
- shim¶
A wrapper function to wrap V1 style function.
- classmethod validate_speaker(v, values)¶
Wrap a classmethod, staticmethod, property or unbound function and act as a descriptor that allows us to detect decorated items from the class’ attributes.
This class’ __get__ returns the wrapped item’s __get__ result, which makes it transparent for classmethods and staticmethods.
- wrapped¶
The decorator that has to be wrapped.
- decorator_info¶
The decorator info.
- shim¶
A wrapper function to wrap V1 style function.
-
language:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.AudioGenerationResponse(**data)¶
Bases:
BaseModel
Response model for audio generation API.
-
audio:
str
¶
-
duration:
float
|None
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
audio:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ChatCompletionRequest(**data)¶
Bases:
BaseModel
Request model for chat completion API.
-
frequency_penalty:
float
|None
¶
-
logit_bias:
dict
[str
,float
] |None
¶
-
logprobs:
int
|None
¶
-
max_tokens:
int
|None
¶
-
messages:
list
[ChatMessage
]¶
-
min_p:
float
|None
¶
-
model:
str
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
n:
int
|None
¶
-
presence_penalty:
float
|None
¶
-
repetition_penalty:
float
|None
¶
-
seed:
int
|None
¶
-
stop:
list
[str
] |None
¶
-
stream:
bool
|None
¶
-
temperature:
float
|None
¶
-
top_k:
int
|None
¶
-
top_logprobs:
int
|None
¶
-
top_p:
float
|None
¶
-
user:
str
|None
¶
-
frequency_penalty:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ChatCompletionResponse(**data)¶
Bases:
BaseModel
Response model for chat completion API.
-
choices:
list
[ChatCompletionResponseChoice
]¶
-
created:
int
¶
-
id:
str
¶
-
model:
str
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
object:
str
¶
-
usage:
ChatCompletionResponseUsage
|None
¶
-
choices:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ChatCompletionResponseChoice(**data)¶
Bases:
BaseModel
A single choice in the chat completion response.
-
finish_reason:
str
|None
¶
-
index:
int
¶
-
message:
ChatCompletionResponseMessage
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
finish_reason:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ChatCompletionResponseMessage(**data)¶
Bases:
BaseModel
A message in the chat completion response.
-
content:
str
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
role:
str
¶
- classmethod validate_role(v)¶
Wrap a classmethod, staticmethod, property or unbound function and act as a descriptor that allows us to detect decorated items from the class’ attributes.
This class’ __get__ returns the wrapped item’s __get__ result, which makes it transparent for classmethods and staticmethods.
- wrapped¶
The decorator that has to be wrapped.
- decorator_info¶
The decorator info.
- shim¶
A wrapper function to wrap V1 style function.
-
content:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ChatCompletionResponseUsage(**data)¶
Bases:
BaseModel
Token usage information.
-
completion_tokens:
int
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
prompt_tokens:
int
¶
-
total_tokens:
int
¶
-
completion_tokens:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ChatMessage(**data)¶
Bases:
BaseModel
A single message in a chat conversation.
-
content:
str
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
role:
str
¶
- classmethod validate_role(v)¶
Wrap a classmethod, staticmethod, property or unbound function and act as a descriptor that allows us to detect decorated items from the class’ attributes.
This class’ __get__ returns the wrapped item’s __get__ result, which makes it transparent for classmethods and staticmethods.
- wrapped¶
The decorator that has to be wrapped.
- decorator_info¶
The decorator info.
- shim¶
A wrapper function to wrap V1 style function.
-
content:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.GeneratedImage(**data)¶
Bases:
BaseModel
A single generated image with its metadata.
-
image:
str
¶
-
index:
int
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
random_seed:
int
¶
-
image:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ImageGenerationRequest(**data)¶
Bases:
BaseModel
Request model for image generation API.
-
backend:
str
¶
-
cfg_scale:
float
|None
¶
-
controlnet_image:
str
|None
¶
-
controlnet_name:
str
|None
¶
-
enable_refiner:
bool
¶
-
height:
int
¶
-
loras:
dict
[str
,float
] |None
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
model_name:
str
¶
-
negative_prompt:
str
|None
¶
-
num_images:
int
¶
-
prompt:
str
¶
-
seed:
int
|None
¶
-
steps:
int
¶
-
style_preset:
str
|None
¶
-
width:
int
¶
-
backend:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ImageGenerationResponse(**data)¶
Bases:
BaseModel
Response model for image generation API.
-
images:
list
[GeneratedImage
]¶
-
inference_time:
float
|None
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
images:
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.types.ImageMetadata(**data)¶
Bases:
BaseModel
Metadata for a generated image.
-
cfg_scale:
float
|None
¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
negative_prompt:
str
|None
¶
-
prompt:
str
|None
¶
-
seed:
int
|None
¶
-
steps:
int
|None
¶
-
cfg_scale:
coinbase_agentkit.action_providers.hyperboliclabs.ai.utils module¶
Utility functions for Hyperbolic AI services.
This module provides utility functions for handling AI service operations such as saving generated data.
- coinbase_agentkit.action_providers.hyperboliclabs.ai.utils.save_base64_data(base64_data, output_path)¶
Save base64 encoded data to a file.
- Parameters:
base64_data (
str
) – The base64 encoded data stringoutput_path (
str
) – Path where to save the file
- Returns:
The absolute path to the saved file
- Return type:
str
- Raises:
ValueError – If the base64 data is invalid
OSError – If there’s an error saving the file
- coinbase_agentkit.action_providers.hyperboliclabs.ai.utils.save_text(text, output_path)¶
Save text data to a file and return a preview.
- Parameters:
text (
str
) – The text to saveoutput_path (
str
) – Path where to save the text file
- Returns:
The absolute path to the saved text file
- Return type:
str
- Raises:
OSError – If there’s an error saving the file
Module contents¶
Hyperbolic AI action provider module.
This module provides actions for interacting with Hyperbolic AI services, including text, image, and audio generation.
- class coinbase_agentkit.action_providers.hyperboliclabs.ai.AIActionProvider(api_key=None)¶
Bases:
ActionProvider
Action provider for generating text, images and audio via AI.
- description = 'Action provider for generating text, images and audio via AI.'¶
- generate_audio(args)¶
Generate audio from text using specified language and speaker.
- Parameters:
args (dict[str, Any]) – Input arguments for the action.
- Returns:
A message containing the action response or error details.
- Return type:
str
- generate_image(args)¶
Generate images using specified model.
- Parameters:
args (dict[str, Any]) – Input arguments for the action.
- Returns:
A message containing the action response or error details.
- Return type:
str
- generate_text(args)¶
Generate text using specified language model.
- Parameters:
args (dict[str, Any]) – Input arguments for the action.
- Returns:
A message containing the action response or error details.
- Return type:
str
- coinbase_agentkit.action_providers.hyperboliclabs.ai.ai_action_provider(api_key=None)¶
Create a new instance of the AIActionProvider.
- Parameters:
api_key (
Optional
[str
]) – Optional API key for authentication. If not provided, will attempt to read from HYPERBOLIC_API_KEY environment variable.- Return type:
- Returns:
A new AI action provider instance.
- Raises:
ValueError – If API key is not provided and not found in environment.