Skip to main content

mellea.stdlib.mobject

MObject.

Classes

Query

A Query component. Methods:

parts

parts(self) -> list[Component | CBlock]
Get the parts of the query.

format_for_llm

format_for_llm(self) -> TemplateRepresentation | str
Format the query for llm.

Transform

A Transform component. Methods:

parts

parts(self) -> list[Component | CBlock]
Get the parts of the transform.

format_for_llm

format_for_llm(self) -> TemplateRepresentation | str
Format the transform for llm.

MObjectProtocol

Protocol to describe the necessary functionality of a MObject. Implementers should prefer inheriting from MObject than MObjectProtocol. Methods:

parts

parts(self) -> list[Component | CBlock]
Returns a list of parts for MObject.

get_query_object

get_query_object(self, query: str) -> Query
Returns the instantiated query object. Args:
  • query : The query string.

get_transform_object

get_transform_object(self, transformation: str) -> Transform
Returns the instantiated transform object. Args:
  • transformation: the transform string

content_as_string

content_as_string(self) -> str
Returns the content of MObject as a string. The default value is just str(self). Subclasses should override this method.

format_for_llm

format_for_llm(self) -> TemplateRepresentation | str
The template representation used by the formatter. The default TemplateRepresentation uses an automatic parsing for tools and fields. The content is retrieved from content_as_string().

MObject

An extension of Component for adding query and transform operations. Methods:

parts

parts(self) -> list[Component | CBlock]
Returns a list of parts for MObject.

get_query_object

get_query_object(self, query: str) -> Query
Returns the instantiated query object. Args:
  • query : The query string.

get_transform_object

get_transform_object(self, transformation: str) -> Transform
Returns the instantiated transform object. Args:
  • transformation: the transform string

content_as_string

content_as_string(self) -> str
Returns the content of MObject as a string. The default value is just str(self). Subclasses should override this method.

format_for_llm

format_for_llm(self) -> TemplateRepresentation | str
The template representation used by the formatter. The default TemplateRepresentation uses an automatic parsing for tools and fields. The content is retrieved from content_as_string().
I