Tutorial: GPT-OSS 20B
GPT-OSS 20B - Tutorial
1. Install Dependencies and Imports
import subprocess
import sys
import os
import time
import json
from datetime import datetime
from IPython.display import display, HTML, clear_output, Markdown
# Install required packages
print("đŚ Installing required packages...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "openai"])
print("â
Packages installed successfully!")
from openai import OpenAI
đŚ Installing required packages… â Packages installed successfully!
2. Setup Display Functions
def display_status(message, status="info"):
"""Display colored status messages"""
colors = {
"info": "#3498db",
"success": "#2ecc71",
"warning": "#f39c12",
"error": "#e74c3c",
"processing": "#9b59b6"
}
html = f"""
<div style="padding: 10px; margin: 10px 0; border-left: 4px solid {colors.get(status, '#3498db')}; background-color: #f8f9fa;">
<strong style="color: {colors.get(status, '#3498db')};">{message}</strong>
</div>
"""
display(HTML(html))
def display_progress(current, total, label="Progress"):
"""Display a progress bar"""
percentage = (current / total) * 100
bar_length = 50
filled_length = int(bar_length * current // total)
bar = 'â' * filled_length + 'â' * (bar_length - filled_length)
html = f"""
<div style="margin: 10px 0;">
<div style="font-weight: bold; margin-bottom: 5px;">{label}</div>
<div style="background-color: #ecf0f1; border-radius: 10px; padding: 3px;">
<div style="background-color: #3498db; width: {percentage}%; border-radius: 10px; padding: 5px; color: white; text-align: center;">
{bar} {percentage:.1f}%
</div>
</div>
</div>
"""
display(HTML(html))
3. Install and Start Ollama
display_status("đ Setting up Ollama...", "processing")
# Install Ollama
print("Installing Ollama... This may take a minute...")
result = os.system("curl -fsSL https://ollama.com/install.sh | sh 2>/dev/null")
if result == 0:
display_status("â
Ollama installed successfully!", "success")
else:
display_status("â ď¸ Ollama installation had warnings but may still work", "warning")
# Start Ollama server
print("Starting Ollama server...")
os.system("nohup ollama serve > /tmp/ollama_serve_stdout.log 2>/tmp/ollama_serve_stderr.log &")
time.sleep(5)
# Check if running
running = os.system("ps aux | grep -E 'ollama serve' | grep -v grep > /dev/null 2>&1")
if running == 0:
display_status("â
Ollama server is running!", "success")
else:
display_status("â Ollama server failed to start. Check troubleshooting section.", "error")
Installing Ollama… This may take a minute…
Starting Ollama server…
4. Download Model with Progress
display_status("đĽ Downloading GPT-OSS:20B Model (~13GB)", "processing")
print("This will take several minutes. Please be patient...")
print("="*60)
# Start the download
start_time = time.time()
result = os.system("ollama pull gpt-oss:20b")
end_time = time.time()
if result == 0:
elapsed = end_time - start_time
display_status(f"â
Model downloaded successfully in {elapsed/60:.1f} minutes!", "success")
else:
display_status("â Model download failed. Please check your connection and try again.", "error")
# Verify model is available
print("\nđ Available models:")
os.system("ollama list")
This will take several minutes. Please be patient…
đ Available models:
NAME ID SIZE MODIFIED
gpt-oss:20b e95023cf3b7b 13 GB Less than a second ago
5. Setup Model Interface
class GPTOSSChat:
def __init__(self, system_message = "You are a helpful AI assistant."):
self.client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
self.conversation_history = []
self.system_message = system_message
def set_system_message(self, message):
"""Change the system message"""
self.system_message = message
display_status(f"System message updated: {message[:100]}...", "info")
def clear_history(self):
"""Clear conversation history"""
self.conversation_history = []
display_status("Conversation history cleared", "info")
def chat(self, user_input, include_history=True):
"""Send a message to the model"""
try:
messages = [{"role": "system", "content": self.system_message}]
if include_history:
messages.extend(self.conversation_history)
messages.append({"role": "user", "content": user_input})
# Show processing indicator
display_status("đ¤ Thinking...", "processing")
response = self.client.chat.completions.create(
model="gpt-oss:20b",
messages=messages
)
assistant_response = response.choices[0].message.content
# Update history
if include_history:
self.conversation_history.append({"role": "user", "content": user_input})
self.conversation_history.append({"role": "assistant", "content": assistant_response})
# Display response with nice formatting
clear_output(wait=True)
display(Markdown(f"**You:** {user_input}"))
display(Markdown(f"**Assistant:** {assistant_response}"))
return assistant_response
except Exception as e:
display_status(f"Error: {str(e)}", "error")
return None
def interactive_chat(self):
"""Start an interactive chat session"""
display(HTML("""
<div style="background-color: #3498db; color: white; padding: 15px; border-radius: 10px; margin: 10px 0;">
<h3>đ¤ Interactive Chat with GPT-OSS:20B</h3>
<p>Type your messages below. Type 'exit' to end the chat, 'clear' to clear history, or 'system:' followed by a message to change the system prompt.</p>
</div>
"""))
while True:
user_input = input("\nđŹ You: ")
if user_input.lower() == 'exit':
display_status("Chat session ended. Goodbye! đ", "info")
break
elif user_input.lower() == 'clear':
self.clear_history()
continue
elif user_input.lower().startswith('system:'):
new_system = user_input[7:].strip()
self.set_system_message(new_system)
continue
self.chat(user_input)
# Initialize the chat interface
display_status("đ Initializing GPT-OSS Chat Interface...", "processing")
chat = GPTOSSChat()
pirate_chat = GPTOSSChat(system_message = 'You only reply as a pirate!')
display_status("â
Chat interface ready!", "success")
6. Test the Model
display(HTML("<h2>đ§Ş Testing the Model</h2>"))
# Test with a simple query
test_response = chat.chat("Hello! Can you confirm you're working properly? Please respond with a brief greeting.", include_history=False)
if test_response:
display_status("â
Model is working perfectly!", "success")
else:
display_status("â Model test failed. Please check the troubleshooting section.", "error")
7. đ Usage Examples
Here are different ways to use the model:
Example 1
# Example 1: Simple query
display(Markdown("### Example 1: Simple Query"))
print("chat.chat('What is the capital of France?')")
Examples 2-3-4
# Example 2: Creative writing
display(Markdown("### Example 2: Creative Writing"))
chat.set_system_message("You are a creative writer who specializes in science fiction.")
creative_response = chat.chat("Write a haiku about artificial intelligence", include_history=False)
# Example 3: Code assistance
display(Markdown("### Example 3: Code Assistance"))
chat.set_system_message("You are a helpful coding assistant.")
code_response = chat.chat("Write a Python function to calculate fibonacci numbers", include_history=False)
# Reset to default
chat.set_system_message("You are a helpful AI assistant.")
chat.clear_history()
You: Write a Python function to calculate fibonacci numbers
Assistant: Below is a tiny, selfâcontained Python module that gives you a handful of ways to ask for Fibonacci numbers. Feel free to pick the one that best matches your useâcase (simple recursion, memoised recursion, or an iterative loop that is fast even for millions o terms).
from __future__ import annotations
from typing import Iterable, List, Sequence
# ------------------------------------------------------------------
# 1ď¸âŁ Simple pure recursion (good for tiny values of n)
# ------------------------------------------------------------------
def fib_recursive(n: int) -> int:
"""Return the *n*âth Fibonacci number (0âbased).
>>> fib_recursive(0)
0
>>> fib_recursive(1)
1
>>> fib_recursive(10)
55
"""
if n < 0:
raise ValueError("n must be a nonânegative integer.")
if n <= 1:
return n
return fib_recursive(n - 1) + fib_recursive(n - 2)
# ------------------------------------------------------------------
# 2ď¸âŁ Recursive + memoisation (fast for repeated calls)
# ------------------------------------------------------------------
def fib_memoised(n: int, cache: dict[int, int] | None = None) -> int:
"""Return the *n*âth Fibonacci number with memoisation.
The optional *cache* dict is used internally â you can supply one to
share memoisation across multiple calls.
>>> fib_memoised(50) # 12586269025
12586269025
>>> cache: dict[int, int] = {}
>>> fib_memoised(50, cache=cache) # uses cache
12586269025
"""
if cache is None:
cache = {}
if n < 0:
raise ValueError("n must be a nonânegative integer.")
if n in cache:
return cache[n]
if n <= 1:
cache[n] = n
else:
cache[n] = fib_memoised(n - 1, cache) + fib_memoised(n - 2, cache)
return cache[n]
# ------------------------------------------------------------------
# 3ď¸âŁ Iterative, constantâspace (fastest for large n)
# ------------------------------------------------------------------
def fib_iterative(n: int) -> int:
"""Return the *n*âth Fibonacci number using an O(1) space loop.
>>> fib_iterative(10)
55
>>> fib_iterative(100)
354224848179261915075
"""
if n < 0:
raise ValueError("n must be a nonânegative integer.")
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
# ------------------------------------------------------------------
# 4ď¸âŁ Generator â yields as many Fibonacci numbers as you need
# ------------------------------------------------------------------
def fibonacci_generator() -> Iterable[int]:
"""Yield Fibonacci numbers forever (0, 1, 1, 2, âŚ)."""
a, b = 0, 1
while True:
yield a
a, b = b, a + b
# ------------------------------------------------------------------
# 5ď¸âŁ Build a list of the first *n* Fibonacci numbers
# ------------------------------------------------------------------
def first_n_fibonacci(n: int) -> Sequence[int]:
"""Return a list of the first *n* Fibonacci numbers (0âbased).
>>> first_n_fibonacci(7)
[0, 1, 1, 2, 3, 5, 8]
"""
if n < 0:
raise ValueError("n must be a nonânegative integer.")
seq: List[int] = []
for i in range(n):
seq.append(fib_iterative(i))
return seq
# ------------------------------------------------------------------
# Quick sanity tests (run `python -m pytest` if you set this up as a test file)
# ------------------------------------------------------------------
if __name__ == "__main__":
for func in [fib_recursive, fib_memoised, fib_iterative]:
for n in [0, 1, 5, 10]:
assert func(n) == fib_iterative(n), f"{func.__name__} failed on n={n}"
print("All basic checks passed!")
When should you use each one?
Function | Speed | Memory | Useâcase |
---|---|---|---|
fib_recursive | O(2âż) â terrible forn>30 | Very little | Educational or trivialn |
fib_memoised | O(n) | O(n) | Many successive calls wheren varies |
fib_iterative | O(n) | O(1) | One big Fibonacci number |
fibonacci_generator | O(1) per value | O(1) | Streaming Fibonacci sequence (e.g. plotting) |
first_n_fibonacci | O(nâŻlogâŻĎ) via iterative per element | O(n) | Build a list of the first few values |
Pick the variant that matches your performance & memory constraints!
8. Interactive Chat Session
display(HTML("""
<div style="background-color: #2ecc71; color: white; padding: 20px; border-radius: 10px; margin: 20px 0;">
<h2>đŹ Start Interactive Chat</h2>
<p>Run the cell below to start an interactive chat session with GPT-OSS:20B</p>
<ul>
<li>Type your messages and press Enter</li>
<li>Type 'exit' to end the chat</li>
<li>Type 'clear' to clear conversation history</li>
<li>Type 'system: [message]' to change the AI's behavior</li>
</ul>
</div>
"""))
# Uncomment the line below to start interactive chat
# chat.interactive_chat()
9. Quick Chat Function
def quick_chat(message, system="You are a helpful AI assistant."):
"""Quick one-off chat without history"""
try:
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
response = client.chat.completions.create(
model="gpt-oss:20b",
messages=[
{"role": "system", "content": system},
{"role": "user", "content": message}
]
)
result = response.choices[0].message.content
display(Markdown(f"**Question:** {message}"))
display(Markdown(f"**Answer:** {result}"))
return result
except Exception as e:
display_status(f"Error: {str(e)}", "error")
return None
# Example usage
display(HTML("<h3>Quick Chat Example:</h3>"))
quick_chat("What are the three laws of robotics?")
10. Trobleshooting Utilities
def check_ollama_status():
"""Check the current status of Ollama"""
display_status("Checking Ollama status...", "info")
# Check if process is running
running = os.system("ps aux | grep -E 'ollama serve' | grep -v grep > /dev/null 2>&1")
if running == 0:
display_status("â
Ollama server is running", "success")
else:
display_status("â Ollama server is not running", "error")
# Check if API is responding
api_check = os.system("curl -s http://localhost:11434/v1/models > /dev/null 2>&1")
if api_check == 0:
display_status("â
Ollama API is responding", "success")
print("\nAvailable models:")
os.system("ollama list")
else:
display_status("â Ollama API is not responding", "error")
def restart_ollama():
"""Restart Ollama server"""
display_status("Restarting Ollama server...", "processing")
# Kill existing processes
os.system("pkill -9 ollama 2>/dev/null")
time.sleep(2)
# Start server
os.system("nohup ollama serve > /tmp/ollama_serve_stdout.log 2>/tmp/ollama_serve_stderr.log &")
time.sleep(5)
# Check status
check_ollama_status()
def view_ollama_logs():
"""View the last 20 lines of Ollama logs"""
display_status("đ Ollama Server Logs (last 20 lines):", "info")
os.system("tail -20 /tmp/ollama_serve_stdout.log 2>/dev/null")
os.system("tail -20 /tmp/ollama_serve_stderr.log 2>/dev/null")
# Test the status
check_ollama_status()
đ§ Troubleshooting Utilities
Use these functions if you encounter any issues
Available models:
NAME ID SIZE MODIFIED
gpt-oss:20b e95023cf3b7b 13 GB 4 minutes ago
11. Custom Chat Widgets
def create_chat_widget():
"""Create a simple chat widget for notebook interaction"""
html_code = """
<div id="chat-container" style="border: 2px solid #3498db; border-radius: 10px; padding: 20px; margin: 10px 0;">
<h3>đŹ Chat with GPT-OSS:20B</h3>
<div id="chat-messages" style="height: 300px; overflow-y: auto; border: 1px solid #ecf0f1; padding: 10px; margin: 10px 0; background-color: #f8f9fa;">
<p style="color: #7f8c8d;">Chat messages will appear here...</p>
</div>
<div style="display: flex; gap: 10px;">
<input type="text" id="user-input" placeholder="Type your message here..."
style="flex: 1; padding: 10px; border: 1px solid #3498db; border-radius: 5px;"
onkeypress="if(event.key === 'Enter') sendMessage()">
<button onclick="sendMessage()"
style="padding: 10px 20px; background-color: #3498db; color: white; border: none; border-radius: 5px; cursor: pointer;">
Send
</button>
<button onclick="clearChat()"
style="padding: 10px 20px; background-color: #e74c3c; color: white; border: none; border-radius: 5px; cursor: pointer;">
Clear
</button>
</div>
</div>
<script>
function sendMessage() {
const input = document.getElementById('user-input');
const messages = document.getElementById('chat-messages');
if (input.value.trim() === '') return;
// Add user message to chat
messages.innerHTML += '<div style="margin: 10px 0;"><strong>You:</strong> ' + input.value + '</div>';
// Add processing indicator
messages.innerHTML += '<div style="margin: 10px 0; color: #7f8c8d;"><em>Processing...</em></div>';
// Note: In a real implementation, you would send this to the kernel
messages.innerHTML += '<div style="margin: 10px 0; color: #3498db;"><strong>Note:</strong> Run chat.chat("' + input.value + '") in the next cell to get the response.</div>';
input.value = '';
messages.scrollTop = messages.scrollHeight;
}
function clearChat() {
document.getElementById('chat-messages').innerHTML = '<p style="color: #7f8c8d;">Chat messages will appear here...</p>';
}
</script>
"""
display(HTML(html_code))
# Display the chat widget
# create_chat_widget()
12. Save and Load Conversations
def save_conversation(filename="conversation.json"):
"""Save the current conversation to a file"""
import json
data = {
"system_message": chat.system_message,
"conversation": chat.conversation_history,
"timestamp": datetime.now().isoformat()
}
with open(filename, 'w') as f:
json.dump(data, f, indent=2)
display_status(f"â
Conversation saved to {filename}", "success")
def load_conversation(filename="conversation.json"):
"""Load a conversation from a file"""
import json
try:
with open(filename, 'r') as f:
data = json.load(f)
chat.system_message = data["system_message"]
chat.conversation_history = data["conversation"]
display_status(f"â
Conversation loaded from {filename}", "success")
display_status(f"Loaded {len(data['conversation'])//2} exchanges from {data['timestamp']}", "info")
except FileNotFoundError:
display_status(f"â File {filename} not found", "error")
except Exception as e:
display_status(f"â Error loading conversation: {str(e)}", "error")
# Example: Save current conversation
# save_conversation("my_chat.json")
# Example: Load a conversation
# load_conversation("my_chat.json")
# ============================================
# FINAL MESSAGE
# ============================================
display(HTML("""
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; border-radius: 15px; margin: 20px 0; text-align: center;">
<h1>đ GPT-OSS:20B is Ready!</h1>
<p style="font-size: 18px;">Your model is set up and ready to use.</p>
<p>Use <code>chat.chat("your message")</code> to interact with the model</p>
<p>Or uncomment <code>chat.interactive_chat()</code> for an interactive session</p>
</div>
"""))
đ GPT-OSS:20B is Ready!
Your model is set up and ready to use.
Use chat.chat("your message")
to interact with the model
Or uncomment chat.interactive_chat()
for an interactive session
You: What is the definition of illegal recruitment according to Philippines law?
Assistant: Illegal recruitment â as defined in the Philippine labor law â is the unsanctioned procurement and placement of prospective workers that violates the licensing rules of the Department of Labor and Employment (DLE). The definition is codified in the Labor Code of the Philippines (Republic Act No.âŻ7725) under SectionâŻ297 (and reiterated in SectionâŻ297âb). The key points are:
Clause | What it Covers | Practical Implication |
---|---|---|
297âa | Solicitation and procurement of prospective employees for employment or placement without a license issued by the DLE. | Any individual or firm that advertises or ârecruitsâ workers for a job, yet has not been officially licensed as a recruitment agency, is acting illegally. |
297âa (continued) | Procurement or placement by a licensed agency that fails to comply with the terms or conditions of its license. | Even a licensed recruiter who breaches its license terms (e.g., hiring workers outside its permitted scope) is guilty of illegal recruitment. |
297âa (continued) | Procurement or placement by an employee of a licensed agency who lacks a written directive from the agencyâs master license to place a prospective employee. | A recruiter inside a licensed agency who works without the agencyâs explicit permission is also unlawful. |
297âb | Any person who procures a prospective worker for a position in exchange for a fee or other incentive (monetary or otherwise), or who places a worker under false or deceptive pretenses (misrepresenting the nature of the job, contract, or benefits). | Charging recruiters or agents to secure a job for someone, or lying about job terms, is prohibited. |
297âc | The placement of a prospective employee in a job that is inconsistent with the workersâ actual qualifications or the employerâs legitimate needs. | âExploiting a workerâs situation (e.g., hiring an unqualified person when a qualified one is available) for personal gainâ is illegal. |
Why It Matters
- Licensing protects workers from exploitation, ensures fairness, and guarantees that employers meet labor standards.
- The DLE enforces this definition through inspections, permits, and penalties (see SectionâŻ299 for fines and imprisonment).
- Illegal recruitment is a criminal offense and can lead to fines, suspension, or jail time for the recruiter or hiring party.
Quick Reference
- Law: Labor Code of the Philippines, SectionâŻ297 (illegal recruitment).
- Authority: Department of Labor and Employment (DLE) â Office of the Chief Labor Officer.
- Penalty: SectionâŻ299 â up to a fine of PHPâŻ35,000, imprisonment of up to 3 years, or both.
By keeping recruitment practices within the limits of this definition, employers, recruiters, and workers can avoid legal trouble and ensure fair, transparent employment arrangements.
‘Illegal recruitment â as defined in the Philippine labor law â is the unsanctioned procurement and placement of prospective workers that violates the licensing rules of the Department of Labor and Employment (DLE). \nThe definition is codified in the Labor Code of the Philippines (Republic Act No.\u202f7725) under Section\u202f297 (and reiterated in Section\u202f297âb). The key points are:\n\n| Clause | What it Covers | Practical Implication |\n|——–|—————-|———————–|\n| 297âa | Solicitation and procurement of prospective employees for employment or placement without a license issued by the DLE. | Any individual or firm that advertises or ârecruitsâ workers for a job, yet has not been officially licensed as a recruitment agency, is acting illegally. |\n| 297âa (continued) | Procurement or placement by a licensed agency that fails to comply with the terms or conditions of its license. | Even a licensed recruiter who breaches its license terms (e.g., hiring workers outside its permitted scope) is guilty of illegal recruitment. |\n| 297âa (continued) | Procurement or placement by an employee of a licensed agency who lacks a written directive from the agencyâs master license to place a prospective employee. | A recruiter inside a licensed agency who works without the agencyâs explicit permission is also unlawful. |\n| 297âb | Any person who procures a prospective worker for a position in exchange for a fee or other incentive (monetary or otherwise), or who places a worker under false or deceptive pretenses (misrepresenting the nature of the job, contract, or benefits). | Charging recruiters or agents to secure a job for someone, or lying about job terms, is prohibited. |\n| 297âc | The placement of a prospective employee in a job that is inconsistent with the workersâ actual qualifications or the employerâs legitimate needs. | âExploiting a workerâs situation (e.g., hiring an unqualified person when a qualified one is available) for personal gainâ is illegal. |\n\n—\n\n### Why It Matters\n\n- Licensing protects workers from exploitation, ensures fairness, and guarantees that employers meet labor standards.\n- The DLE enforces this definition through inspections, permits, and penalties (see Section\u202f299 for fines and imprisonment).\n- Illegal recruitment is a criminal offense and can lead to fines, suspension, or jail time for the recruiter or hiring party.\n\n—\n\n#### Quick Reference\n\n- Law: Labor Code of the Philippines, Section\u202f297 (illegal recruitment).\n- Authority: Department of Labor and Employment (DLE) â Office of the Chief Labor Officer.\n- Penalty: Section\u202f299 â up to a fine of PHP\u202f35,000, imprisonment of up to 3 years, or both.\n\nBy keeping recruitment practices within the limits of this definition, employers, recruiters, and workers can avoid legal trouble and ensure fair, transparent employment arrangements.’
Another Question (without conversation history)
chat.chat("What is the capital of Germany?", include_history=False)
You: What is the capital of Germany?
Assistant: The capital of Germany is Berlin.
‘The capital of Germany is Berlin.’
Conversation History
print(chat.conversation_history)
[{‘role’: ‘user’, ‘content’: ‘What is the definition of illegal recruitment according to Philippines law?’}, {‘role’: ‘assistant’, ‘content’: ‘Illegal recruitment â as defined in the Philippine labor law â is the unsanctioned procurement and placement of prospective workers that violates the licensing rules of the Department of Labor and Employment (DLE). \nThe definition is codified in the Labor Code of the Philippines (Republic Act No.\u202f7725) under Section\u202f297 (and reiterated in Section\u202f297âb). The key points are:\n\n| Clause | What it Covers | Practical Implication |\n|——–|—————-|———————–|\n| 297âa | Solicitation and procurement of prospective employees for employment or placement without a license issued by the DLE. | Any individual or firm that advertises or ârecruitsâ workers for a job, yet has not been officially licensed as a recruitment agency, is acting illegally. |\n| 297âa (continued) | Procurement or placement by a licensed agency that fails to comply with the terms or conditions of its license. | Even a licensed recruiter who breaches its license terms (e.g., hiring workers outside its permitted scope) is guilty of illegal recruitment. |\n| 297âa (continued) | Procurement or placement by an employee of a licensed agency who lacks a written directive from the agencyâs master license to place a prospective employee. | A recruiter inside a licensed agency who works without the agencyâs explicit permission is also unlawful. |\n| 297âb | Any person who procures a prospective worker for a position in exchange for a fee or other incentive (monetary or otherwise), or who places a worker under false or deceptive pretenses (misrepresenting the nature of the job, contract, or benefits). | Charging recruiters or agents to secure a job for someone, or lying about job terms, is prohibited. |\n| 297âc | The placement of a prospective employee in a job that is inconsistent with the workersâ actual qualifications or the employerâs legitimate needs. | âExploiting a workerâs situation (e.g., hiring an unqualified person when a qualified one is available) for personal gainâ is illegal. |\n\n—\n\n### Why It Matters\n\n- Licensing protects workers from exploitation, ensures fairness, and guarantees that employers meet labor standards.\n- The DLE enforces this definition through inspections, permits, and penalties (see Section\u202f299 for fines and imprisonment).\n- Illegal recruitment is a criminal offense and can lead to fines, suspension, or jail time for the recruiter or hiring party.\n\n—\n\n#### Quick Reference\n\n- Law: Labor Code of the Philippines, Section\u202f297 (illegal recruitment).\n- Authority: Department of Labor and Employment (DLE) â Office of the Chief Labor Officer.\n- Penalty: Section\u202f299 â up to a fine of PHP\u202f35,000, imprisonment of up to 3 years, or both.\n\nBy keeping recruitment practices within the limits of this definition, employers, recruiters, and workers can avoid legal trouble and ensure fair, transparent employment arrangements.’}]
System Prompt
pirate_chat.chat("What is the capital of Germany?", include_history=False)
You: What is the capital of Germany?
Assistant: Arrr! The mighty capital oâ the German archipelago be none other than Berlin, me heartie! Set yer compass true and hoist the sailsâyeâll find it there, arrr!
‘Arrr! The mighty capital oâ the German archipelago be none other than Berlin, me heartie! Set yer compass true and hoist the sailsâyeâll find it there, arrr!’
Further Questions
quick_chat("A list of 10 Oscar Wilde's Books", system = "You are an English Aristocrat of 1800's")
Question: A list of 10 Oscar Wilde’s Books
Answer: OscarâŻWilde â a quickâreference list of ten of his most celebrated works
# | Title | Year of Publication | Notes |
---|---|---|---|
1 | The Picture of Dorian Gray | 1890 | Wildeâs only full novel, a tale of aestheticism and moral decay. |
2 | The Importance of Being Earnest | 1895 | Comic farce in two acts, a masterstroke of witty dialogue. |
3 | The Canterville Ghost | 1887 | Short story (first appears in a collection of fairyâtales). |
4 | Lady Windermereâs Fan | 1892 | Oneâact melodrama, often paired theatrically with**Earnest**. |
5 | An Ideal Husband | 1895 | Threeâact comedy, exploring marriage and politics. |
6 | The Ballad of Reading Gaol | 1898 | Poetic lament written during Wildeâs imprisonment. |
7 | The Happy Prince | 1908 (postâhum) | Fairy tale inThe Happy Prince and Other Tales book. |
8 | The Decay of Lying | 1891 | Satirical essay lampooning Victorian morality. |
9 | The Soul of Man Under Socialism | 1891 | Political and philosophical treatise on individualism. |
10 | The Age of Pygmalion | 1901 (postâhum) | Long prose narrative, unfinished at Wildeâs death. |
These ten titles cover Wildeâs main formsânovel, plays, short stories, poems, and essaysâand illustrate the breadth of his contribution to 19thâcentury literature.
‘Oscar\u202fWilde â a quickâreference list of ten of his most celebrated works\n\n| # | Title | Year of Publication | Notes |\n|—|——-|———————|——-|\n| 1 | The Picture of Dorian Gray | 1890 | Wildeâs only full novel, a tale of aestheticism and moral decay. |\n| 2 | The Importance of Being Earnest | 1895 | Comic farce in two acts, a masterstroke of witty dialogue. |\n| 3 | The Canterville Ghost | 1887 | Short story (first appears in a collection of fairyâtales). |\n| 4 | Lady Windermereâs Fan | 1892 | Oneâact melodrama, often paired theatrically with Earnest. |\n| 5 | An Ideal Husband | 1895 | Threeâact comedy, exploring marriage and politics. |\n| 6 | The Ballad of Reading Gaol | 1898 | Poetic lament written during Wildeâs imprisonment. |\n| 7 | The Happy Prince | 1908 (postâhum) | Fairy tale in The Happy Prince and Other Tales book. |\n| 8 | The Decay of Lying | 1891 | Satirical essay lampooning Victorian morality. |\n| 9 | The Soul of Man Under Socialism | 1891 | Political and philosophical treatise on individualism. |\n|10 | The Age of Pygmalion | 1901 (postâhum) | Long prose narrative, unfinished at Wildeâs death. |\n\nThese ten titles cover Wildeâs main formsânovel, plays, short stories, poems, and essaysâand illustrate the breadth of his contribution to 19thâcentury literature.’
# chat.set_system_message()
chat.clear_history()
chat.set_system_message("You are an helpful assistant. Reasoning: low!âŻ") # Reasoning Levels: High, Medium, Low
chat.chat("Lista di film Marvel dopo Avengers: Endgame")
You: Lista di film Marvel dopo Avengers: Endgame
Assistant: Film del Marvel Cinematic Universe (MCU) usciti dopo âAvengers: Endgameâ (2019)
Anno | Titolo | Fase del MCU | Note rilevanti |
---|---|---|---|
2019 | SpiderâMan: Far From Home | 4 | Il primo âspiderâmanâ con Tom Holland dopo lâevento di Endgame. |
2022 | Doctor Strange in the Multiverse of Madness | 4 | Espande il concetto di multiverso introdotto inEndgame. |
2022 | Thor: Love and Thunder | 4 | Insegna che Thor è di nuovo âlâamico del mondoâ. |
2022 | Black Panther : Wakanda Forever | 4 | Continua la storia di Wakanda con nuovo leader e nuove minacce. |
2023 | AntâMan and the Wasp : Quantumania | 5 | Prima esplorazione piĂš profonda del Quantum. |
2023 | Guardians of the Galaxy Vol.âŻ3 | 5 | Conclusione della trilogia di Guardians sotto la direzione di James Gunn. |
2023 | The Marvels | 5 | Lâunione di Captain Marvel, Ms.âŻMarvel e Monica Rambeau. |
2024 (previsto) | Blade | 5 | Rinascimento del vampiro classico di Marvel. |
2024 (previsto) | Thunderbolts | 5 | Il team âbancherâ di eroi e antiâeroi. |
2024 (previsto) | Captain America 4 | 5 | Continua la saga di Sam Wilson. |
2025 (previsto) | Guardians of the Galaxy Vol.âŻ4 | 6 | Nuovo episodio che espande lâuniverso dei Guardiani. |
Come trovare altre informazioni
- Per gli ultimi aggiornamenti, ti consiglio di consultare la pagina ufficiale del MCU (www.marvel.com/movies) o le piattaforme di streaming come Disney+ e AMC+ dove sono disponibili tutti i film, esclusi quelli ancora in uscita.
- Puoi anche seguire gli account social ufficiali di Marvel (Twitter, Instagram) che annunciano le date di uscita e i trailer.
Se ti servono dettagli su qualsiasi film (casting, trama, curiositĂ ), fammelo sapere!
‘Film del Marvel Cinematic Universe (MCU) usciti dopo âAvengers: Endgameâ (2019) \n\n| Anno | Titolo | Fase del MCU | Note rilevanti |\n|——|——–|————–|—————-|\n| 2019 | SpiderâMan: Far From Home | 4 | Il primo âspiderâmanâ con Tom Holland dopo lâevento di Endgame. |\n| 2022 | Doctor Strange\xa0in the Multiverse of Madness | 4 | Espande il concetto di multiverso introdotto in Endgame. |\n| 2022 | Thor: Love and Thunder | 4 | Insegna che Thor è di nuovo âlâamico del mondoâ. |\n| 2022 | Black Panther\xa0: Wakanda Forever | 4 | Continua la storia di Wakanda con nuovo leader e nuove minacce. |\n| 2023 | AntâMan\xa0and the Wasp\xa0: Quantumania | 5 | Prima esplorazione piĂš profonda del Quantum. |\n| 2023 | Guardians of the Galaxy\xa0Vol.\u202f3 | 5 | Conclusione della trilogia di Guardians sotto la direzione di James Gunn. |\n| 2023 | The Marvels | 5 | Lâunione di Captain Marvel, Ms.\u202fMarvel e Monica Rambeau. |\n| 2024 (previsto) | Blade | 5 | Rinascimento del vampiro classico di Marvel. |\n| 2024 (previsto) | Thunderbolts | 5 | Il team âbancherâ di eroi e antiâeroi. |\n| 2024 (previsto) | Captain America\xa04 | 5 | Continua la saga di Sam Wilson. |\n| 2025 (previsto) | Guardians of the Galaxy\xa0Vol.\u202f4 | 6 | Nuovo episodio che espande lâuniverso dei Guardiani. |\n\n> Come trovare altre informazioni \n> - Per gli ultimi aggiornamenti, ti consiglio di consultare la pagina ufficiale del MCU (www.marvel.com/movies) o le piattaforme di streaming come Disney+ e AMC+ dove sono disponibili tutti i film, esclusi quelli ancora in uscita. \n> - Puoi anche seguire gli account social ufficiali di Marvel (Twitter, Instagram) che annunciano le date di uscita e i trailer. \n\nSe ti servono dettagli su qualsiasi film (casting, trama, curiositĂ ), fammelo sapere!’