Skip to content

Commit babf75d

Browse files
authored
Docs/pipe llm multiplicity (Pipelex#106)
* Fixed docs about PipeLM multiplicity params
1 parent 336cb02 commit babf75d

8 files changed

Lines changed: 21 additions & 9 deletions

File tree

.github/workflows/guard-branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
if [[ "$HEAD" == "dev" ]]; then
3737
exit 0
3838
fi
39-
if [[ ! "$HEAD" =~ ^(fix|feature|refactor|chore|doc|ci-cd|changelog|codex)\/[A-Za-z0-9._\/\<\>\=\-]+$ ]]; then
39+
if [[ ! "$HEAD" =~ ^(fix|feature|refactor|chore|docs|ci-cd|changelog|codex)\/[A-Za-z0-9._\/\<\>\=\-]+$ ]]; then
4040
echo "::error::Branch must start with fix/, feature/, refactor/, chore/, docs/, or ci-cd/."
4141
exit 1
4242
fi

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We are open to contributions in all areas of our core Pipelex library:
1212
- **Feature**: New API, CLI flag, module, test coverage
1313
- **Refactor**: Rethink architecture
1414
- **Chore**: Dependency updates, config tweaks, file renames
15-
- **Doc**: Main docs, SWE Agent rules, tutorials, examples, READMEs
15+
- **Docs**: Main docs, SWE Agent rules, tutorials, examples, READMEs
1616
- **CI/CD**: GitHub Actions, packaging, release tooling
1717

1818
## Contribution process
@@ -22,7 +22,7 @@ We are open to contributions in all areas of our core Pipelex library:
2222
- Install dependencies: `make install` (creates .venv and installs dependencies)
2323
- Copy `.env.example` to `.env` and fill in required API keys (at least OpenAI)
2424
- Run checks to make sure all is good: `make check` & `make test`
25-
- Create a branch with the format user_name/category/short_slug where category is one of: `feature`, `fix`, `refactor`, `doc`, `cicd` or `chore`
25+
- Create a branch with the format user_name/category/short_slug where category is one of: `feature`, `fix`, `refactor`, `docs`, `cicd` or `chore`
2626
- Make and commit changes
2727
- Push your local branch to your fork
2828
- Open a PR that [links to an existing Issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) which does not include the `needs triage` label

docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeLLM.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,18 @@ Analyze the document page shown in the image and explain how it relates to the p
121121
| `images` | list of strings | **Deprecated**: Use the `inputs` section to declare image inputs instead. | No |
122122
| `structuring_method` | string | The method for generating structured output. Can be `direct` or `preliminary_text`. Defaults to the global configuration. | No |
123123
| `prompt_template_to_structure` | string | The prompt template for the second step in `preliminary_text` mode. | No |
124+
| `nb_output` | integer | Specifies exactly how many outputs to generate (e.g., `nb_output = 3` for exactly 3 outputs). Use when you need a fixed number of results. Mutually exclusive with `multiple_output`. | No |
125+
| `multiple_output` | boolean | Controls output generation mode. Default is `false` (single output). Set to `true` for variable-length list generation when you need an indeterminate number of outputs. Mutually exclusive with `nb_output`. | No |
126+
127+
### Output Generation Modes
128+
129+
`PipeLLM` supports three different output generation modes:
130+
131+
1. **Single Output** (default): Don't specify `nb_output` or `multiple_output`, or set `multiple_output = false`. The LLM generates exactly one result.
132+
133+
2. **Fixed Multiple Outputs**: Use `nb_output = N` (where N is a positive integer) when you need exactly N outputs. For example, `nb_output = 3` will try to generate 3 results. The parameter `_nb_output` will be available in the prompt template, e.g. "Give me the names of $_nb_output flowers".
134+
135+
3. **Variable Multiple Outputs**: Use `multiple_output = true` when you need a variable-length list where the LLM determines how many outputs to generate based on the content and context.
124136
| `output_multiplicity` | string or integer | Defines the number of outputs. Use `"list"` for a variable-length list, or an integer (e.g., `3`) for a fixed-size list. | No |
125137

126138
## Examples

pipelex/pipe_operators/pipe_img_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ async def _dry_run_operator_pipe(
283283
pipe_run_params: PipeRunParams,
284284
output_name: Optional[str] = None,
285285
) -> PipeOutput:
286-
log.warning(f"PipeImgGen: dry run operator pipe: {self.code}")
286+
log.info(f"PipeImgGen: dry run operator pipe: {self.code}")
287287
content_generator_dry = ContentGeneratorDry()
288288
pipe_output = await self._run_operator_pipe(
289289
job_metadata=job_metadata,

pipelex/pipe_operators/pipe_jinja2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ async def _dry_run_operator_pipe(
141141
) -> PipeOutput:
142142
content_generator_used: ContentGeneratorProtocol
143143
if get_config().pipelex.dry_run_config.apply_to_jinja2_rendering:
144-
log.warning(f"PipeJinja2: using dry run operator pipe for jinja2 rendering: {self.code}")
144+
log.info(f"PipeJinja2: using dry run operator pipe for jinja2 rendering: {self.code}")
145145
content_generator_used = ContentGeneratorDry()
146146
else:
147-
log.warning(f"PipeJinja2: using regular operator pipe for jinja2 rendering (dry run not applied to jinja2): {self.code}")
147+
log.info(f"PipeJinja2: using regular operator pipe for jinja2 rendering (dry run not applied to jinja2): {self.code}")
148148
content_generator_used = get_content_generator()
149149
pipe_output = await self._run_operator_pipe(
150150
job_metadata=job_metadata,

pipelex/pipe_operators/pipe_llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ async def _dry_run_operator_pipe(
489489
pipe_run_params: PipeRunParams,
490490
output_name: Optional[str] = None,
491491
) -> PipeOutput:
492-
log.warning(f"PipeLLM: dry run operator pipe: {self.code}")
492+
log.info(f"PipeLLM: dry run operator pipe: {self.code}")
493493
content_generator_dry = ContentGeneratorDry()
494494
pipe_output = await self._run_operator_pipe(
495495
job_metadata=job_metadata,

pipelex/pipe_operators/pipe_ocr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ async def _dry_run_operator_pipe(
228228
pipe_run_params: PipeRunParams,
229229
output_name: Optional[str] = None,
230230
) -> PipeOutput:
231-
log.warning(f"PipeOcr: dry run operator pipe: {self.code}")
231+
log.info(f"PipeOcr: dry run operator pipe: {self.code}")
232232
content_generator_dry = ContentGeneratorDry()
233233
pipe_output = await self._run_operator_pipe(
234234
job_metadata=job_metadata,

pipelex/pipe_operators/pipe_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async def _dry_run_operator_pipe(
7373
pipe_run_params: PipeRunParams,
7474
output_name: Optional[str] = None,
7575
) -> PipeOutput:
76-
log.warning(
76+
log.info(
7777
f"PipeOperator: dry run method called for operator pipe: {self.code}, but no dry run method is implemented for {self.__class__.__name__}"
7878
)
7979
return await self._run_operator_pipe(

0 commit comments

Comments
 (0)