עודכן: אוגוסט 2026 · מתעדכן דו-שבועית
ספריית סקריפטים
סקריפטים ואוטומציות מוכנים — workflows ל-n8n, קוד Python לקריאת מודלים ו-RAG, ופקודות Shell. העתק, הורד, והרץ אצלך. הכל בחינם.
code— סקריפטים
איך משתמשים
1. הורד / העתק
כל סקריפט ניתן להעתקה או להורדה כקובץ מוכן (.json / .py / .sh).
2. הכנס מפתחות
החלף YOUR_API_KEY ופרטים בסוגריים [כך] בשלך.
3. הרץ
workflows של n8n מייבאים דרך Import from File; Python/Shell מריצים ישירות.
בטיחות: אף פעם אל תכניס מפתח API לתוך קוד ששיתפת. השתמש במשתני סביבה (
OPENAI_API_KEY) או בקובץ .env. מזהי המודלים בדוגמאות נכונים לאוגוסט 2026 וייתכן שיתעדכנו.
n8n Workflows
Webhook → AI → תשובה
n8nJSON
{
"name": "Webhook to AI Reply",
"nodes": [
{ "parameters": { "httpMethod": "POST", "path": "ai-reply" },
"name": "Webhook", "type": "n8n-nodes-base.webhook",
"typeVersion": 1, "position": [400, 300] },
{ "parameters": { "url": "https://api.openai.com/v1/chat/completions",
"method": "POST", "sendHeaders": true,
"headerParameters": { "parameters": [
{ "name": "Authorization", "value": "Bearer YOUR_API_KEY" },
{ "name": "Content-Type", "value": "application/json" } ] },
"sendBody": true, "specifyBody": "json",
"jsonBody": "={\"model\":\"gpt-5.6\",\"messages\":[{\"role\":\"user\",\"content\":$json.body.message}]}" },
"name": "OpenAI", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4, "position": [640, 300] },
{ "parameters": { "respondWith": "json",
"responseBody": "={{ $json.choices[0].message.content }}" },
"name": "Respond", "type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1, "position": [880, 300] }
],
"connections": {
"Webhook": { "main": [[{ "node": "OpenAI", "type": "main", "index": 0 }]] },
"OpenAI": { "main": [[{ "node": "Respond", "type": "main", "index": 0 }]] }
}
}
מתוזמן — סיכום יומי למייל
n8nJSON
{
"name": "Daily Digest to Email",
"nodes": [
{ "parameters": { "rule": { "interval": [{ "field": "cronExpression", "expression": "0 8 * * *" }] } },
"name": "Every day 08:00", "type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1, "position": [400, 300] },
{ "parameters": { "url": "[YOUR_DATA_SOURCE_URL]" },
"name": "Fetch Data", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4, "position": [640, 300] },
{ "parameters": { "url": "https://api.openai.com/v1/chat/completions",
"method": "POST", "sendHeaders": true,
"headerParameters": { "parameters": [
{ "name": "Authorization", "value": "Bearer YOUR_API_KEY" } ] },
"sendBody": true, "specifyBody": "json",
"jsonBody": "={\"model\":\"gpt-5.6\",\"messages\":[{\"role\":\"user\",\"content\":\"סכם ל-5 נקודות: \"+ $json.data}]}" },
"name": "Summarize", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4, "position": [880, 300] },
{ "parameters": { "toEmail": "[YOUR_EMAIL]", "subject": "סיכום יומי",
"text": "={{ $json.choices[0].message.content }}" },
"name": "Send Email", "type": "n8n-nodes-base.emailSend",
"typeVersion": 2, "position": [1120, 300] }
],
"connections": {
"Every day 08:00": { "main": [[{ "node": "Fetch Data", "type": "main", "index": 0 }]] },
"Fetch Data": { "main": [[{ "node": "Summarize", "type": "main", "index": 0 }]] },
"Summarize": { "main": [[{ "node": "Send Email", "type": "main", "index": 0 }]] }
}
}
Python — AI
OpenAI — קריאת צ'אט
PythonOpenAI
# pip install openai | export OPENAI_API_KEY="sk-..."
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY from env
resp = client.chat.completions.create(
model="gpt-5.6",
messages=[
{"role": "system", "content": "ענה בעברית, תמציתי."},
{"role": "user", "content": "[הבקשה שלך כאן]"},
],
)
print(resp.choices[0].message.content)
Claude — קריאת הודעה
PythonAnthropic
# pip install anthropic | export ANTHROPIC_API_KEY="sk-ant-..."
import anthropic
client = anthropic.Anthropic()
msg = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "[הבקשה שלך כאן]"}],
)
print(msg.content[0].text)
עיבוד Batch של קבצים
PythonBatch
# עיבוד כל קובצי הטקסט בתיקייה עם מודל זול
import os, glob
from openai import OpenAI
client = OpenAI()
for path in glob.glob("input/*.txt"):
text = open(path, encoding="utf-8").read()
resp = client.chat.completions.create(
model="gpt-5.6", # לנפח גדול שקול מודל זול יותר
messages=[{"role": "user", "content": f"סכם ב-3 נקודות:\n{text}"}],
)
out = path.replace("input/", "output/")
os.makedirs("output", exist_ok=True)
open(out, "w", encoding="utf-8").write(resp.choices[0].message.content)
print("done:", out)
RAG — שאילתה על מסמכים
PythonRAG
# RAG מינימלי: embed -> retrieve -> answer
from openai import OpenAI
import numpy as np
client = OpenAI()
docs = ["[מסמך 1]", "[מסמך 2]", "[מסמך 3]"]
def embed(texts):
r = client.embeddings.create(model="text-embedding-3-small", input=texts)
return np.array([e.embedding for e in r.data])
doc_vecs = embed(docs)
def ask(question):
q = embed([question])[0]
sims = doc_vecs @ q
top = docs[int(sims.argmax())] # הקטע הרלוונטי ביותר
r = client.chat.completions.create(
model="gpt-5.6",
messages=[{"role": "system", "content": f"ענה רק לפי:\n{top}\nאם אין תשובה - אמור 'לא יודע'."},
{"role": "user", "content": question}],
)
return r.choices[0].message.content
print(ask("[השאלה שלך]"))
Shell / CLI
הרצת מודל מקומי (Ollama)
Shellמקומי · חינם
# התקן Ollama מ- https://ollama.com , ואז:
ollama run qwen3 # צ'אט אינטראקטיבי, רץ מקומית בחינם
# או דרך ה-API המקומי (פורט 11434):
curl http://localhost:11434/api/generate -d '{
"model": "qwen3",
"prompt": "כתוב פונקציית Python שמחזירה מספרי פיבונאצ׳י",
"stream": false
}'
קריאה ל-OpenAI מה-CLI (curl)
Shellcurl
export OPENAI_API_KEY="sk-..."
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6",
"messages": [{"role": "user", "content": "[הבקשה שלך]"}]
}'
tips_and_updates
רוצה יותר?
הספרייה מתעדכנת דו-שבועית עם סקריפטים חדשים. את הפרומפטים תמצא בספריית הפרומפטים, ואת ההסבר המלא במדריך n8n.