Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::AsyncGenerator< T > Class Template Reference

A minimal AsyncGenerator implementation that doesn't rely on coroutines. More...

#include <coroutine_utils.h>

Public Member Functions

 AsyncGenerator (std::function< std::vector< T >()> func)
 Constructor.
 
std::vector< T > collect ()
 Collect the results.
 

Detailed Description

template<typename T>
class agents::AsyncGenerator< T >

A minimal AsyncGenerator implementation that doesn't rely on coroutines.

Template Parameters
TThe type of the elements in the AsyncGenerator

Constructor & Destructor Documentation

◆ AsyncGenerator()

template<typename T>
agents::AsyncGenerator< T >::AsyncGenerator ( std::function< std::vector< T >()> func)
inline

Constructor.

Parameters
funcThe function to collect the results

Member Function Documentation

◆ collect()

template<typename T>
std::vector< T > agents::AsyncGenerator< T >::collect ( )
inline

Collect the results.

Returns
A vector of the results