ailets

Actor interface

Preliminary version.

The actor interface defines how ailets interact with their environment. Each ailet is an actor that receives input through streams and produces output through streams.

get_name

Name of the actor.

n_of_streams

int n_of_streams(const char *param_name);

Return the number of input streams associated with a given parameter.

The number of input streams associated with a parameter may change dynamically during program execution.

open_read

int open_read(const char *param_name, unsigned int idx);

Open the idxth stream associated with the parameter param_name.

Return a file descriptor on success, or -1 on error. In case of error, errno is set.

open_write

int open_write(const char *param_name);

Open a write stream associated with the parameter param_name.

Return a file descriptor on success, or -1 on error. In case of error, errno is set.

read

int read(int fd, voif buffer[count], int count)

Read up to count bytes from the file descriptor fd into the buffer.

Return the number of bytes read. If the end of the file is encountered, 0 is returned. On error, -1 is returned, and errno is set appropriately.

write

int write(int fd, const void buffer[count], int count);

Writes up to count bytes from the buffer to the file descriptor fd.

Return the number of bytes written, which might be less than count. On error, return -1 and sets errno appropriately.

The following file descriptors are predefined:

close

int close(int fd);

Close the file descriptor fd.

read_dir

char **read_dir(const char *path);

Read the contents of the directory path into an array of strings.

pass_through

void pass_through(const char *in_stream_name, const char *out_stream_name);

Connect the input stream in_stream_name to the output stream out_stream_name.

get_next_name

char *get_next_name(const char *base_name);

Return an unique name with the prefix base_name.

errno, strerror

int errno;
char *strerror(int errnum);
void perror(const char *s);

As seen in POSIX.

Communication with the orchestrator

Based on the experience developing a tool for gpt4o, the following functions were sufficient: