m1guelpf/generalagentskit
An unofficial Swift SDK for the [General Agents API](https://docs.generalagents.com/).
Installation
<details>
<summary> Swift Package Manager </summary>
Add the following to your Package.swift:
dependencies: [
.package(url: "https://github.com/m1guelpf/GeneralAgentsKit.git", .branch("main"))
]</details> <details>
<summary>Installing through XCode</summary>
- File > Swift Packages > Add Package Dependency
- Add https://github.com/m1guelpf/GeneralAgentsKit.git
- Select "Branch" with "main"
</details>
<details>
<summary>CocoaPods</summary>
Ask ChatGPT to help you migrate away from CocoaPods.
</details>
Usage
let agent = Agent(model: .aceSmall, apiKey: YOUR_GENERAL_AGENTS_API_KEY)
let computer = Computer()
let session = agent.start("Star the m1guelpf/GeneralAgentsKit github repository")
var observation = try await computer.observe()
while true {
let action = try await session.plan(observation: observation)
print("Executing: \(action)")
if action.kind == "stop" { break }
observation = try await computer.execute(action)
}Package Metadata
Repository: m1guelpf/generalagentskit
Default branch: main
README: README.md