## Writer Cookbooks

Writer Cookbooks are step-by-step guides to help you implement tasks and solve common problems using Writer. Each recipe includes code snippets, explanations, and best practices to enhance your understanding of the Writer platform.

## Featured

[**Multimodal chat completion**  
Send both text and images in the same message to enable rich, visual conversations with Palmyra X5.](https://github.com/writer/cookbooks/blob/main/completion/multimodal_chat_x5.ipynb)

[**Third-party models**  
Call third-party Amazon Bedrock models via the Writer SDK, including chat and tool calling.](https://github.com/writer/cookbooks/blob/main/models/Amazon_Bedrock.ipynb)

[**Knowledge Graph**  
Use our RAG implementation to create, manage, and use structured data to enhance AI capabilities.](https://github.com/writer/cookbooks/blob/main/knowledge_graph/knowledge_graph.ipynb)

## All cookbooks

### Applications

[**Working with no-code agents**  
Retrieve no-code agent metadata and generate output from them using the Writer SDK.](https://github.com/writer/cookbooks/blob/main/applications/application_basic_usage.ipynb)

[**Knowledge Graph management**  
Attach a Knowledge Graph to a no-code agent programmatically.](https://github.com/writer/cookbooks/blob/main/applications/application_graph_management.ipynb)

[**Run no-code agents asynchronously**  
Run no-code agents asynchronously and manage asynchronous jobs.](https://github.com/writer/cookbooks/blob/main/applications/application_jobs_utilization.ipynb)

### Completions

[**Text completion**  
Use the Writer Python SDK for text completion tasks.](https://github.com/writer/cookbooks/blob/main/completion/text_completion.ipynb)

[**Chat completion**  
Build single-turn and multi-turn chat completions to support conversational AI applications.](https://github.com/writer/cookbooks/blob/main/completion/chat_completion.ipynb)

[**Structured completions**  
Get predictable, machine-readable responses from Palmyra LLMs using JSON Schema or Pydantic objects.](https://github.com/writer/cookbooks/blob/main/completion/structured_output_cookbook.ipynb)

### Knowledge Graph

[**Knowledge Graph tool calling**  
Access a Knowledge Graph in a chat.](https://github.com/writer/cookbooks/blob/main/tool_calling/tool_calling_kg.ipynb)

### Integrations

[**Instructor basics**  
Extract structured data from text, CSV, and PDF files using Instructor and Writer.](https://github.com/writer/cookbooks/blob/main/integrations/instructor/Instructor.ipynb)

[**Advanced Instructor**  
Work with nested Pydantic models, retry and repair patterns, and streaming using Instructor and Writer.](https://github.com/writer/cookbooks/blob/main/integrations/instructor/Advanced.ipynb)

[**LangChain basics**  
Use Writer with LangChain to build chat workflows and LangGraph agents with tool calling.](https://github.com/writer/cookbooks/blob/main/integrations/langchain/LangChain.ipynb)

### Models

[**List all models**  
List all of the Palmyra models available in the Writer API.](https://github.com/writer/cookbooks/blob/main/models/model_retrieval.ipynb)

### Tool calling

[**Tool calling fundamentals**  
Learn how to use tool calling to enhance the functionality of your LLM.](https://github.com/writer/cookbooks/blob/main/tool_calling/tool_calling_api.ipynb)

[**LLM tool calling**  
Use model delegation to refer a task to another model during a chat.](https://github.com/writer/cookbooks/blob/main/tool_calling/tool_calling_llm.ipynb)

[**Streaming tool calls**  
Use tool calling with streaming responses.](https://github.com/writer/cookbooks/blob/main/tool_calling/tool_calling_streaming.ipynb)

### Tools

[**PDF parser**  
Parse a PDF file and extract the text as text or markdown.](https://github.com/writer/cookbooks/blob/main/tools/pdf_parser.ipynb)
