Skip to content

v0.2.1

Latest

Choose a tag to compare

@zhangdw156 zhangdw156 released this 02 Jan 06:39
· 15 commits to main since this release

Sloop v0.2.1

This release introduces multithreaded dialog generation for significantly faster dataset creation, along with improved error handling and a refined logging system.

🚀 New Features

Multithreaded Dialog Generation

  • [cite_start]Concurrent Execution: Added the --concurrency (alias -j) parameter to the CLI, allowing parallel generation of multiple dialog chains.
  • Quantity-Guaranteed Loop: Implemented a robust generation loop using the wait(..., return_when=FIRST_COMPLETED) pattern. [cite_start]If a generation task fails (e.g., due to API errors), a replacement task is automatically spawned to ensure the requested count is exactly met.
  • [cite_start]Thread-Safe Sampling: Implemented global thread locks (threading.Lock) for the graph sampling engine to ensure diverse starting nodes are selected without race conditions during parallel execution.

🛡️ Stability & Improvements

Smart Error Handling

  • Context Window Fallback: Added a smart retry mechanism for litellm.ContextWindowExceededError. [cite_start]If a prompt exceeds the token limit, the engine automatically retries the generation with a reduced rag_top_k value (halving the number of RAG examples).
  • [cite_start]Hallucination Prevention: hardened agent prompts (specifically in assistant_decide and selector templates) with strict prohibitions against inventing tools or parameters not defined in the schema.

Logging & Developer Experience

  • Separated Logging Streams:
    • [cite_start]Console: Now uses tqdm_sink to display only WARNING and ERROR logs, ensuring the progress bar remains clean and visual artifacts are minimized.
    • [cite_start]File Log: Detailed DEBUG and INFO logs are written to logs/sloop.log, now including thread names to assist in debugging concurrent processes.
  • [cite_start]Reduced Noise: Suppressed verbose debug output from LiteLLM to keep the console output focused.

⚡ Usage

Generate 100 dialogs using 4 concurrent threads:

sloop generate --count 100 --concurrency 4