Skip to content

Instantly share code, notes, and snippets.

View amosgyamfi's full-sized avatar

Amos Gyamfi amosgyamfi

View GitHub Profile
from phi.agent import Agent
from phi.model.openai import OpenAIChat
task = "Create a SwiftUI view that allows users to switch between the tab bar and sidebar views using TabView and .tabView(.sidebarAdaptable) modifier. Put the content in TabSidebar.swift"
reasoning_agent = Agent(
model=OpenAIChat(id="gpt-4o-mini"),
reasoning=True,
markdown=True,
structured_outputs=True,
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.tools.duckduckgo import DuckDuckGo
from phi.tools.yfinance import YFinanceTools
web_search_agent = Agent(
name="Web Search Agent",
role="Search the web for information",
model=OpenAIChat(id="gpt-4o"),
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.tools.duckduckgo import DuckDuckGo
web_agent = Agent(
name="Web Agent",
model=OpenAIChat(id="gpt-4o-mini"),
tools=[DuckDuckGo()],
instructions=["Always include sources"],
show_tool_calls=True,
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.tools.duckduckgo import DuckDuckGo
web_agent = Agent(
name="Web Agent",
model=OpenAIChat(id="gpt-4o-mini"),
tools=[DuckDuckGo()],
instructions=["Always include sources"],
show_tool_calls=True,
//
// Thinking2.swift
// CoreSwiftUI
//
import SwiftUI
struct ThinkingWithAlex: View {
@State private var currentPhraseIndex = 0
private let timer = Timer.publish(every: 5, on: .main, in: .common).autoconnect()
@State private var thinking = true
# We are now heading towards the future where AI agents will be used to perform many of our daily routine tasks. Anthropic, Microsoft Copilot Studio, IBM Agent. Swarm provides a simple and clean framework for building and running agents with pure Python code.
from swarm import Swarm, Agent
# Define your preferred model to use. If you dont specify a model, the default will be gpt-4o. So you can override it with a smaller model if you want.
mini_model = "gpt-4o-mini"
# Start an agent: Initialize a swarm client. This is the entry point for all agents. Behind the scenes, it will manage the API calls to the LLM provider.
client = Swarm()
import os
import openai
import chainlit as cl
from llama_index.core import (
Settings,
StorageContext,
VectorStoreIndex,
SimpleDirectoryReader,
load_index_from_storage,
//
// ThreadsLogoDrawing.swift
// CoreSwiftUI
import SwiftUI
struct ThreadsLogoPath: Shape {
func path(in rect: CGRect) -> Path {
var path = Path()
let width = rect.size.width
//
// BasiciOSCalculator.swift
import SwiftUI
struct BasiciOSCalculator: View {
@State private var displayValue: String = "0"
@State private var currentOperation: Operation? = nil
@State private var previousValue: Double? = nil
@State private var shouldResetDisplay: Bool = false
//
// MovingDashPhaseButton.swift
// CoreSwiftUI
//
// Created by Amos Gyamfi on 24.8.2024.
//
import SwiftUI
struct MovingDashPhaseButton: View {