AlpacaDataCollector

class AlpacaDataCollector(BaseDataCollector):

init

def __init__(self):

record

def record(self, agent: Union[List[ChatAgent], ChatAgent]):

Inject an agent into the data collector.

Parameters:

  • agent (Union[List[ChatAgent], ChatAgent]): The agent to inject.

convert

def convert(self):

Convert the collected data into a dictionary.

llm_convert

def llm_convert(
    self,
    converter: Optional[OpenAISchemaConverter] = None,
    prompt: Optional[str] = None
):

Convert collected data using an LLM schema converter.

Parameters:

  • converter (Optional[OpenAISchemaConverter], optional): The converter to use. (default: :obj:OpenAISchemaConverter)
  • prompt (Optional[str], optional): Prompt to guide the conversion. (default: :obj:DEFAULT_CONVERTER_PROMPTS)

Returns:

Dict[str, str]: The converted data.