1. datable_ai package

1.1. Subpackages

1.2. Submodules

1.3. datable_ai.main module

1.4. datable_ai.output module

class datable_ai.output.Output(llm_type: LLM_TYPE, prompt_template: str)[source]

Bases: object

A class for generating output using a language model.

Args:

llm_type (LLM_TYPE): The type of language model to use. prompt_template (str): The prompt template to use for generating output.

invoke(**kwargs)[source]

Generates output using the language model.

Args:

**kwargs: Keyword arguments to pass to the prompt template.

Returns:

The generated output.

Raises:

RuntimeError: If an error occurs while generating output.

1.5. datable_ai.structured_output module

class datable_ai.structured_output.StructuredOutput(llm_type: LLM_TYPE, prompt_template: str, output_fields: List[Dict[str, Any]])[source]

Bases: object

A class for generating structured output using a language model.

Args:

llm_type (LLM_TYPE): The type of language model to use. prompt_template (str): The prompt template to use for generating output. output_fields (List[Dict[str, Any]]): A list of dictionaries representing the fields of the structured output.

invoke(**kwargs) str[source]

Generates structured output using the language model.

Args:

**kwargs: Keyword arguments to pass to the prompt template.

Returns:

The generated structured output as a JSON string.

1.6. Module contents

class datable_ai.OCR(llm_type: LLM_TYPE, prompt_template: str)[source]

Bases: object

invoke(image_path: str)[source]

Invoke the OCR process on the given image.

Args:

image_path (str): The path to the image file.

Returns:

The result of the OCR process.

class datable_ai.Output(llm_type: LLM_TYPE, prompt_template: str)[source]

Bases: object

A class for generating output using a language model.

Args:

llm_type (LLM_TYPE): The type of language model to use. prompt_template (str): The prompt template to use for generating output.

invoke(**kwargs)[source]

Generates output using the language model.

Args:

**kwargs: Keyword arguments to pass to the prompt template.

Returns:

The generated output.

Raises:

RuntimeError: If an error occurs while generating output.

class datable_ai.StructuredOutput(llm_type: LLM_TYPE, prompt_template: str, output_fields: List[Dict[str, Any]])[source]

Bases: object

A class for generating structured output using a language model.

Args:

llm_type (LLM_TYPE): The type of language model to use. prompt_template (str): The prompt template to use for generating output. output_fields (List[Dict[str, Any]]): A list of dictionaries representing the fields of the structured output.

invoke(**kwargs) str[source]

Generates structured output using the language model.

Args:

**kwargs: Keyword arguments to pass to the prompt template.

Returns:

The generated structured output as a JSON string.