Skip to content
Back to skills

Generation And Model Components

ASecurity

"Choose and configure Haystack prompt builders, generators,

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
ai-agentsazureapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill generation-and-model-components --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Generation And Model Components?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Generation And Model Components
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-generation-and-model-components/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-generation-and-model-components)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: generation-and-model-components
description: "Choose and configure Haystack prompt builders, generators,
  embedders, classifiers, samplers, validators, and provider/model-backed
  components."
disable-model-invocation: true
metadata:
  disco-role: operating
license: NOASSERTION
---

# Generation and Model Components

Use this sub-skill when the task is about model-facing Haystack components: prompt construction, text or chat generation, embeddings, local/API provider setup, model-backed classification, answer formatting, sampling, JSON validation, credentials, streaming, or optional model dependencies.

## Route Here

- Build prompts with `PromptBuilder` or `ChatPromptBuilder`, including Jinja variables, chat-message templates, runtime template overrides, and required variables.
- Select generators or chat generators such as `OpenAIChatGenerator`, `AzureOpenAIChatGenerator`, `HuggingFaceAPIChatGenerator`, `HuggingFaceLocalChatGenerator`, `OpenAIGenerator`, `AzureOpenAIGenerator`, and Hugging Face local/API text generators.
- Configure embedders for model-backed query/document embeddings, including OpenAI, Azure OpenAI, Hugging Face API, Sentence Transformers, sparse, dense, local, and async variants.
- Add model-backed classifiers, `TopPSampler`, `AnswerBuilder`, `JsonSchemaValidator`, `Secret`, structured output, and streaming callbacks.
- Debug optional dependency, credential, backend, JSON schema, generation parameter, device, or provider-specific failures.

## Reroute Elsewhere

- For pipeline graph construction, component sockets, custom components, loops, serialization, and breakpoints, use `../pipelines-and-components/SKILL.md`.
- For document stores, retrievers, rankers, RAG retrieval strategy, indexing, and hybrid search, use `../retrieval-and-rag/SKILL.md`.
- For agents, tools, tool invocation, human-in-the-loop, and multi-step orchestration, use `../agents-tools-and-hitl/SKILL.md`.
- For evaluators, tracing, metrics, experiment comparison, and observability, use `../evaluation-and-observability/SKILL.md`.

## Fast Workflow

1. Identify whether the model slot expects `str`, `list[ChatMessage]`, `Document`, or `list[Document]`; choose text generators for `prompt -> replies`, chat generators for `messages -> replies`, embedders for vectors, and classifiers/samplers/validators for post-processing.
2. Use `PromptBuilder` for plain string prompts and `ChatPromptBuilder` for chat models; set `required_variables="*"` or a concrete list when missing variables must fail instead of rendering as empty strings.
3. Use `Secret.from_env_var(...)` for provider credentials and avoid hard-coded tokens; pass model parameters through `generation_kwargs`, `huggingface_pipeline_kwargs`, embedder constructor options, or runtime `run(..., generation_kwargs=...)` overrides.
4. Add `JsonSchemaValidator` or provider structured-output `response_format` when the downstream task needs machine-readable JSON; route `validation_error` back into a correction loop at the pipeline layer.
5. Run `scripts/model_component_smoke_check.py` to verify public imports, prompt rendering, answer extraction, sampling, and JSON validation without network credentials.

## References

- `references/api-reference.md` lists the core component imports, inputs, outputs, and configuration knobs.
- `references/model-and-provider-guide.md` explains provider selection, credentials, optional dependencies, local devices, streaming, and structured outputs.
- `references/troubleshooting.md` maps common install/import, credential/backend, API misuse, data/config, and workflow failures to fixes.
- `scripts/model_component_smoke_check.py` is a deterministic smoke check for importable public APIs and non-network component behavior.

Files in this skill

  • SKILL.md3.7 KB
  • references/api-reference.md11.9 KB
  • references/model-and-provider-guide.md10.1 KB
  • references/troubleshooting.md10.5 KB
  • scripts/model_component_smoke_check.py4.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.