patternsstrategy
Strategy Pattern pattern for C development
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Strategy Pattern
Define a family of algorithms as interchangeable function pointers. Clients select which algorithm to use at runtime without changing calling code.
ikigai Application
LLM Provider abstraction: Each provider (OpenAI, Anthropic, Google) implements same interface:
typedef struct {
res_t (*send)(void *ctx, ik_message_t **msgs, size_t count);
res_t (*stream)(void *ctx, ik_message_t **msgs, chunk_cb cb);
} ik_llm_provider_t;
Selection: Config determines which provider vtable is used. REPL calls through interface, unaware of provider.
Testing: Inject mock provider that returns canned responses.
Future: Tool execution strategies, different database backends.
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!