Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
[Brief description ]
- [more description]
- [more description]
- [more description]
| from typing import Literal, Optional, List | |
| from ollama import chat | |
| from pydantic import BaseModel, Field | |
| from utils import save_album_details_to_markdown | |
| from models import Album, Song | |
| import os | |
| def process_album_image(path: str) -> Album: |
| import os | |
| from models import Album | |
| def save_album_details_to_markdown(album: Album, output_path: str = "album_details.md"): | |
| """ | |
| Save album details to a markdown file in the album_notes directory. | |
| Args: | |
| album: Album object containing the details |
| from openai import OpenAI | |
| import openai | |
| from pydantic import BaseModel | |
| # Initialize OpenAI client with local Ollama endpoint | |
| client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama") | |
| class NER(BaseModel): | |
| organizations: list[str] |
| from pydantic import BaseModel | |
| import requests | |
| """ | |
| This script demonstrates the use of Pydantic's `model_dump()` to convert a model | |
| into a Python dictionary. Key points: | |
| 1. **Dot Notation**: | |
| - Use dot notation (e.g., `person.name`) for accessing individual fields. | |
| - Ideal when field names are known and operations are simple. |
| import os | |
| from dotenv import load_dotenv | |
| from typing import List | |
| from google import genai | |
| from google.genai import types | |
| load_dotenv() | |
| GOOGLE_API_KEY = os.getenv('GOOGLE_API_KEY') | |
| MODEL_ID = "gemini-2.0-flash-thinking-exp-1219" # @param ["gemini-2.0-flash-exp","gemini-1.5-flash-002","gemini-1.5-pro-002","gemini-2.0-flash-exp"] {"allow-input":true} | |
| import requests | |
| import pathlib | |
| import os | |
| # Prepare the file to be downloaded | |
| PDF = "https://storage.googleapis.com/generativeai-downloads/data/Smoothly%20editing%20material%20properties%20of%20objects%20with%20text-to-image%20models%20and%20synthetic%20data.pdf" # @param {type: "string"} | |
| # Specify the directory to download the file | |
| DOWNLOAD_DIR = "./downloads" # Set your desired download directory here | |
Setting Up MCP Servers on Windows A step-by-step guide to setting up Model Context Protocol (MCP) servers for Claude Desktop on Windows.
Prerequisites Install Node.js (v18.x or later)
Download from: https://nodejs.org/ Verify installation by opening Command Prompt (CMD) and running: node --version npm --version
| <purpose> | |
| You are an expert prompt engineer, capable of creating detailed and effective prompts for language models. | |
| Your task is to generate a comprehensive prompt based on the user's input structure. | |
| Follow the instructions closely to generate a new prompt template. | |
| </purpose> | |
| <instructions> | |
| <instruction>Analyze the user-input carefully, paying attention to the purpose, required sections, and variables.</instruction> |
| You are an expert regex string creator and understand how regex works. Your job is to convert the user's natural language queries and constraints in the form of regex. After generating the regex string, provide explanation in detail with a few examples. Then demonstrate its use in a python code. | |
| User query: | |
| Give me the regex equivalent of the following: | |
| My requirements are: | |
| I want my string to have 2-63 characters. | |
| The string should be alphanumeric and can contain - also. | |