Skip to content

Instantly share code, notes, and snippets.

View denisakera's full-sized avatar

Denisa Kera denisakera

View GitHub Profile
import os
import time
from dotenv import load_dotenv
from openai import OpenAI
import requests
from PIL import Image
from io import BytesIO
# Load API key from .env file
load_dotenv()
@denisakera
denisakera / gist:3b24c6bb3a72c9357ce6f3ebb27bc5cd
Last active May 4, 2025 08:23
using images for fortune telling
import os
from dotenv import load_dotenv
from openai import OpenAI
# Load API key from .env file
load_dotenv()
API_KEY = os.getenv("OPENAI_API_KEY")
# Initialize the OpenAI client
client = OpenAI(api_key=API_KEY)
@denisakera
denisakera / gist:84cbdccc256426a47a8fc83c7d8a30e5
Last active April 6, 2025 11:40
Tutorial for Chat Completion
from openai import OpenAI
import os
from dotenv import load_dotenv
# Load API key from .env file
load_dotenv()
API_KEY = os.getenv("OPENAI_API_KEY")
# Initialize the OpenAI client
client = OpenAI(api_key=API_KEY)
OpenAI
NewsApiClient (news headline)
SerAPI (Google trends)
JOURNALIST_PERSONA = """You're a journalist with the biting wit of Christopher Hitchens, tasked with analyzing the collective psyche through search trends. Your unique talent lies in using these digital footprints—what people search for in private—to expose the raw, unfiltered reality beneath official narratives.
Your job is to decode these search patterns like a psychological X-ray, revealing the true preoccupations, fears, and absurdities that occupy people's minds while the state trumpets its grand narratives. Use dark humor and sharp insight to contrast the public face of events with the private thoughts revealed through search trends, showing how these digital confessions often tell a more honest story than any official report."""
def generate_analysis(trends_data, headlines):
"""Generate analysis contrasting trends with news"""
context = {
@denisakera
denisakera / config.json
Created October 20, 2024 16:14
mirrorconfig.json
{
"world_name": "Influence campaign",
"locations": [
{
"name": "Telegram Group",
"description": "This English-speaking group facilitates linking, commenting, and rapid sharing of uncensored messages, which may include misleading or false information. The group consists of various members: authentic citizens, malicious bots spreading misinformation and hostile narratives, and benign AI-driven agents aimed at protecting authentic citizens from malicious propaganda and hostile narratives disseminated by malicious bots. These malicious bots often share fake news articles, and sensationalist content intended to manipulate the opinions and emotions of authentic citizens or to reinforce specific narratives."
}
],
"agents": [
{
@denisakera
denisakera / config.json
Created October 20, 2024 16:04
AIMirror
{
"world_name": "Influence campaign",
"locations": [
{
"name": "Telegram Group",
"description": "This English-speaking group facilitates linking, commenting, and rapid sharing of uncensored messages, which may include misleading or false information. The group consists of various members: authentic citizens, malicious bots spreading misinformation and hostile narratives, and benign AI-driven agents aimed at protecting authentic citizens from malicious propaganda and hostile narratives disseminated by malicious bots. These malicious bots often share fake news articles, and sensationalist content intended to manipulate the opinions and emotions of authentic citizens or to reinforce specific narratives."
}
],
"agents": [
{
import re
from enum import Enum
from langchain.schema import BaseMessage, SystemMessage
from pydantic import BaseModel
class Examples(Enum):
PLAN_EXAMPLES = [""]
@denisakera
denisakera / gist:48f24a4ea88f86fb46b4683a0885003e
Created September 15, 2024 17:11
krakow-workshop-agents
{
"world_name": "Apocalypse Club",
"locations": [
{
"name": "Crisis Forum",
"description": "A heated arena where influential leaders, experts, and influencers debate which looming global catastrophe demands immediate policy attention. The forum sets the stage for apocalyptic predictions and competing arguments on whose crisis is the ultimate."
}
],
"agents": [
{
@denisakera
denisakera / Gossip-config.json
Created September 5, 2024 07:02
Config file for the Gossip simulation
{
"world_name": "Gossip world",
"locations": [
{"name": "Courtyard",
"description": "Courtyard where neighbours meet to gossip about each other and fight over various public issues."
}
],
"agents": [
{
"first_name": "Vera",
@denisakera
denisakera / AI-future-config.json
Last active September 5, 2024 07:00
AI future agent simulation propmts
{
"world_name": "Future of AI",
"locations": [
{
"name": "Arena",
"description": "Place for public discussionswhere citizens confront each others views and fight over various issues."
}
],
"agents": [
{