abacusai.llm_code_block

Module Contents

Classes

LlmCodeBlock

Parsed code block from an LLM response

class abacusai.llm_code_block.LlmCodeBlock(client, language=None, code=None, start=None, end=None, valid=None)

Bases: abacusai.return_class.AbstractApiClass

Parsed code block from an LLM response

Parameters:
  • client (ApiClient) – An authenticated API Client instance

  • language (str) – The language of the code block. Eg - python/SQL/etc.

  • code (str) – source code string

  • start (number(integer)) – index of the starting character of the code block in the original response

  • end (number(integer)) – index of the last character of the code block in the original response

  • valid (bool) – flag denoting whether the soruce code string is syntactically valid

__repr__()

Return repr(self).

to_dict()

Get a dict representation of the parameters in this class

Returns:

The dict value representation of the class parameters

Return type:

dict