Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buhe/aisummary
SwiftUI app based on langchain-swift.
https://github.com/buhe/aisummary
Last synced: 19 days ago
JSON representation
SwiftUI app based on langchain-swift.
- Host: GitHub
- URL: https://github.com/buhe/aisummary
- Owner: buhe
- License: gpl-3.0
- Created: 2023-07-19T08:00:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-04T04:12:20.000Z (over 1 year ago)
- Last Synced: 2025-01-01T20:02:17.170Z (about 2 months ago)
- Language: Swift
- Homepage:
- Size: 16 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Support: Support.md
Awesome Lists containing this project
README
# AI Summary
SwiftUI app based on [langchain-swift](https://github.com/buhe/langchain-swift).## Get started
Edit your https://github.com/buhe/AISummary/blob/main/ShareExt/env.txt, set your openai_key.If you find it troublesome or want to support me, go to https://apps.apple.com/us/app/ai-summarize-pro/id6450951898
## Core Code
```swift
let loader = YoutubeLoader(video_id: video_id, language: lang)
let doc = await loader.load()
let p = """
YouTubeビデオの字幕は次のとおりです:%@、メインコンテンツを100語以内に要約してください。
"""
let prompt = PromptTemplate(input_variables: ["youtube"], template: p)
let request = prompt.format(args: [String(doc.first!.page_content.prefix(2000))])
let llm = OpenAI()
let reply = await llm.send(text: request)
```