Skip to content

Instantly share code, notes, and snippets.

View xianminx's full-sized avatar
🏠
Working from home

xianminx

🏠
Working from home
View GitHub Profile
@xianminx
xianminx / swarm_music_multi_agents.py
Created November 12, 2024 06:30
Swarm cannot support multi agents to work concurrently.
from typing import List
from swarm import Agent
from swarm.repl.repl import run_demo_loop
# Simulated music player and lyrics database
music_library = {
"Bohemian Rhapsody": {
"artist": "Queen",
"lyrics": "Is this the real life? Is this just fantasy?...",
@xianminx
xianminx / README.md
Last active October 24, 2024 04:37
Demo show when multiple agents are called in parallel, only the last agent is running when using OpenAI's Swarm framework

Running Multiple Agents in Parallel with the OpenAI Swarm Framework

Issue: Parallel Execution of Agents

In the current implementation, when multiple tools return agents, the code enters a loop where intermediate agent executions are lost. Specifically, if more than one tool provides an agent, the context from one agent is overwritten, leading to incorrect or incomplete execution.

For instance, consider the following code from core.py:

@xianminx
xianminx / 100S218.mjs
Created October 8, 2024 03:59
西方文明史 搬运到 Youtube 和 Spotify
/**
* # 西方文明史 搬运到 Youtube 和 Spotify
*
* [西方文明史](https://ocw.aca.ntu.edu.tw/ntu-ocw/ocw/cou/100S218/1) 是台湾大学 歷史系 劉慧教授所讲。
* 多年前在通勤路上听过一个学期,非常受教。 搬运到 Youtube 和 Spotify(音频) 方便大家观看。
*
* 本課程將介紹西方文明在公元 1500 年之前上古、古典、中古時期的發展。課程從文明的起源、近東地區文字與城市的出現談起;
* 進入西方文明之典範的希臘、羅馬時期後,將以哲學思想、政治組織為重心;接著介紹基督...
*/
@xianminx
xianminx / The Art of Close Reading_1.md
Created August 4, 2024 07:20
# The Art of Close Reading (Part One)

The Art of Close Reading (Part One)

Introduction

  • Developing one's thinking about reading is essential to engaging in close reading.
  • Students must learn to determine the worth of a text and take ownership of its important ideas.
  • Close reading involves the active use of intellectual skills and guided practice based on theory.

Reading for a Purpose

  • Skilled readers read with a purpose, which varies based on the situation and text.
  • Reading aims to understand what the author conveys on a subject.
@xianminx
xianminx / Organization_Principle.md
Last active August 2, 2024 08:55
组织原则 (Organization Principle)
title markmap
组织原则
colorFreezeLevel
2

组织原则 Organization Principle

1. 层级原则(Hierarchy Principle)

@xianminx
xianminx / Schema Theory in Reading.md
Last active August 3, 2024 09:18
Schema Theory In Reading Preview at hhttps://m3-swart.vercel.app/mind/interactive?gist=https%3A%2F%2Fgist.githubusercontent.com%2Fxianminx%2F4f3f3b8e9433aa5191682025caf7a51b%2Fraw%2FSchema%2520Theory%2520in%2520Reading.md&tab=mindmap
title markmap
Schema Theory in Reading
colorFreezeLevel initialExpandLevel
2
3

Schema Theory in Reading

Definition of Schema

@xianminx
xianminx / "The Myth of Sisyphus" by Albert Camus.md
Created July 17, 2024 14:53
"The Myth of Sisyphus" by Albert Camus

"The Myth of Sisyphus" by Albert Camus

Introduction

  1. Opening Statement

    • Camus begins with a bold statement about the significance of the question of suicide, suggesting it is the most important philosophical question because it deals with the meaning of life.
  2. The Absurd

    • He introduces the concept of the absurd, which arises from the conflict between the human desire for meaning and the silent, indifferent universe.

Part 1: An Absurd Reasoning

@xianminx
xianminx / products.ts
Created August 25, 2023 04:45
solid-createResource
const fetchProducts = async () => {
const res = await fetch('https://fakestoreapi.com/products');
const data = await res.json();
return data;
}
export default function ProductList() {
const [products] = createResource(() =>
fetchProducts()
);
@xianminx
xianminx / README.md
Created August 8, 2019 16:03 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]