dataflow.api.base¶
Attributes¶
Classes¶
Request model for LLM configuration. |
|
Response model for LLM generation. |
|
Configuration for a tool to be used with the LLM. |
Functions¶
|
Generate a response using dynamically configured LLM. |
|
Retrieve API key from environment variables based on provider. |
|
Root. |
Module Contents¶
- class dataflow.api.base.LLMConfigRequest(/, **data: Any)¶
Bases:
pydantic.BaseModel
Request model for LLM configuration.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- provider: haive.dataflow.api.models.llm.provider_types.LLMProvider = None¶
- tools: list[ToolConfig] | None = None¶
- class dataflow.api.base.LLMGenerationResponse(/, **data: Any)¶
Bases:
pydantic.BaseModel
Response model for LLM generation.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- provider: haive.dataflow.api.models.llm.provider_types.LLMProvider = None¶
- class dataflow.api.base.ToolConfig(/, **data: Any)¶
Bases:
pydantic.BaseModel
Configuration for a tool to be used with the LLM.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- async dataflow.api.base.generate_response(request: LLMConfigRequest, query: str = Query(..., description='The input query or message to generate a response for'))¶
Generate a response using dynamically configured LLM.
- Parameters:
request (LLMConfigRequest) – LLM configuration details
query (str) – User’s input query
- dataflow.api.base.get_env_api_key(provider: haive.dataflow.api.models.llm.provider_types.LLMProvider) str | None ¶
Retrieve API key from environment variables based on provider.
- Parameters:
provider (haive.dataflow.api.models.llm.provider_types.LLMProvider)
- Return type:
str | None
- async dataflow.api.base.root()¶
Root.
- dataflow.api.base.AI_MODELS¶
- dataflow.api.base.app¶