Ragex.Embeddings.TextGenerator (Ragex v0.12.0)

View Source

Generates embeddable text descriptions from code entities.

Converts modules, functions, and other code entities into natural language descriptions suitable for embedding generation and semantic search.

Functions enriched with MetaAST metadata (from Ragex.Analyzers.Metastatic) include additional semantic context in their text:

  • async: true -- annotated as "async function"
  • is_macro: true -- annotated as "macro"
  • decorators: [...] -- decorator names listed
  • guards: ... -- annotated as "with guards"
  • type_annotations: [...] -- type information listed

Summary

Functions

Generates text for a call relationship.

Generates text description for a function.

Generates text description for a function with its body/implementation.

Generates text for an import relationship.

Generates text description for a module.

Functions

call_text(call_data)

Generates text for a call relationship.

Describes which function calls which other function.

function_text(function_data)

Generates text description for a function.

Includes function signature, module context, documentation, visibility, and any MetaAST semantic metadata (async, macro, guards, decorators, annotations).

function_with_code_text(function_data, code_snippet)

Generates text description for a function with its body/implementation.

Includes signature and code snippet for more detailed semantic search.

import_text(import_data)

Generates text for an import relationship.

Describes which module imports which other module.

module_text(module_data)

Generates text description for a module.

Includes module name, documentation, and metadata.