Metadata-Version: 2.4
Name: gink-ai
Version: 0.3.23
Summary: Gink in your terminal and in Python: chat, web search, images and managed agents with your Gink API key.
Author: Gink AI
License-Expression: MIT
Project-URL: Homepage, https://amgib00.github.io/GinkAssistant/
Project-URL: Source, https://github.com/Amgib00/GinkAssistant
Keywords: gink,ai,assistant,cli,chat,agents,sdk
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.25

# Gink in your terminal

```bash
pip install gink-ai
gink login                                   # opens your browser to approve -- a passkey works (or: gink login --key)
gink "What's the weather where I am?"
gink                                         # chat: /new, /model NAME, /models, /search on|off, /memory, /forget, /exit
cat notes.txt | gink "summarise this"
gink -s "latest news in my country"             # search the web (with sources)
gink news                                     # today's top stories from newsrooms around the world, with their videos
gink --image "a baobab at sunset" -o tree.png
gink see label.jpg "what does this say?"     # about a photo (Gink Pro)
gink models
```

Your key can also come from `GINK_API_KEY`; another server from `GINK_BASE_URL`
(default `https://gink-server.onrender.com/v1`). `gink logout` forgets the saved key.

## Images

```bash
gink --image "a lighthouse at dawn" --style watercolor --aspect 16:9
gink ideas                                            # ready-made looks
gink --image "my dog" --idea statue --photo dog.jpg   # start from your own photo
gink --image "an x-ray of my camera"                  # X-ray, exploded view, cutaway: picked from your words
```

## Photos and videos

```bash
gink see broken-tap.jpg                    # Gink works out what it needs: reads text, finds what's wrong, solves sums
gink see menu.jpg "translate this"
gink watch clip.mp4 "why does my camera look like this?"   # a video: a few frames, in order (needs ffmpeg)
```

Like the Live camera in the apps: careful with anything about health (general terms only, never a diagnosis or a
dose, and "get help now" when it could be urgent). In a workspace in healthcare mode, nothing that identifies a
patient is read out.

## Links

```bash
gink read https://www.facebook.com/reel/2322629778521786      # what it is: who posted it, its caption, what it shows
gink read https://www.youtube.com/watch?v=dQw4w9WgXcQ "summarise it in French"
gink "what does this say about rainy season roads? https://www.bbc.com/news/..."   # links in a question: opened too
```

Pages, PDFs, pictures, audio files, and social media posts and reels (Facebook, Instagram, TikTok, YouTube, X,
Threads, Bluesky...). A link to a video file, or to a page with its own video (a news site, a shared Dropbox or Google
Drive file), is watched whole: moments from start to end, and what's said in the first 30 minutes. For a reel, Gink
sees what a messaging app's preview shows -- the caption, the cover picture, who posted it -- and says so; `gink
watch` a saved video to have it watched whole.

In `gink` (chat), a long conversation keeps its own memory -- what it's about, what was decided, what's left --
so it stays on track after older messages no longer fit: `/memory` shows it, `/forget` clears it. Answers print as
clean text: headings, lists and code without their Markdown marks.

## Files and websites

```bash
gink read budget-2027.xlsx                        # every sheet, row by row (dates as dates)
gink read rainy-season-plan.pptx "what's the first step?"   # an answer from the file
gink site "A one-page site for Ama's bakery in Osu, Accra, with opening hours"
gink sites                                        # yours, with their addresses
gink site edit ID "make the header green"  |  gink site get ID page.html  |  gink site rm ID
```

## Workspaces

```bash
gink workspace                  # your workspace (a hospital, school or business) and your role
gink workspace safety --days 30 # admins, healthcare mode: patient details removed or stopped, photos checked
```

The safety report is counts only, never what anyone wrote. In Python: `client.workspace.safety(days=30)`.

## Projects

```bash
gink projects new "Kyoto in April" --kind travel     # gink projects kinds lists every kind
gink projects add ID hotel-shortlist.pdf notes.md   # files Gink reads in the project's chats
gink projects add ID --text packing.md "An umbrella and comfortable shoes"
gink --project ID "Plan day two"                     # an answer that knows the project
gink projects show ID   |   gink projects instructions ID "Prices in euros"   |   gink projects rm ID
```

They're the same projects as in the Workspace of Gink's apps. In Python: `client.projects.create(...)`, then
`client.chat("Plan day two", project=id)`.

## Smarter agents

```bash
gink agent "Compare three phone plans and write plans.md" --effort high --project ID
gink run analysis.py              # Python or JavaScript in Gink's sandbox, where it's switched on
```

Agents plan, check facts in more than one source, work out numbers exactly and review a substantial answer before
they give it (`--no-review` skips that). `--effort` is auto by default: high to plan and to check.

## Agents fix their work

When an agent changes files, Gink checks the whole environment before it finishes (links to files that don't
exist, JSON or Python that doesn't parse) and fixes what it finds. `gink env check ID` checks one yourself.

## Scheduled agents

```bash
gink schedule add "Update report.md with today's news" --every daily --at 08:00
gink schedule list        # run ID | pause ID | resume ID | rm ID
gink schedule add "Weekly report" --every weekly --at 09:00 --webhook https://example.com/gink-hook
gink webhook secret       # what the notifications are signed with
```

In your server (Python): `event = gink.verify_webhook(request_body_bytes, request.headers["Gink-Signature"], secret)`.

## In Python (the SDK)

```python
from gink import Client

client = Client()                                    # GINK_API_KEY, or the key `gink login` saved
it = client.interactions.create(input="Research solar growth in my country and write report.md", environment="remote")
print(it.output_text, it.files_changed, it.environment)

for event in client.interactions.create(input="Update report.md with this year's numbers",
                                        previous_interaction_id=it.id, stream=True):
    print(event.type, event.data)                    # live: step, status, done

print(client.chat("What's the weather where I am right now?"))    # live information included
found = client.search("When is the next election in my country?", with_sources=True)
for s in found["sources"]:                                           # official sources first, each with its real logo
    print("official" if s["official"] else "        ", s["title"], s["url"], s["icon"])
png = client.image("my dog", idea="figurine", photo="dog.jpg")         # Media Studio's looks
print(client.see("receipt.jpg", "add these up"))                       # about a photo (Gink Pro)
print(client.watch("clip.mp4", "what happens here?"))                  # about a video: its frames (ffmpeg; Gink Pro)
reel = client.read_link("https://www.facebook.com/reel/2322629778521786")   # a link: page, PDF, post, reel...
print(reel.kind, reel.get("author"), reel.get("text"), reel.get("seen"))    # "reel", who posted it, caption, picture
print(client.read_file("budget-2027.xlsx"))                                 # PDF, Word, Excel, PowerPoint, LibreOffice
site = client.websites.create("A page for Kofi's tailoring shop in Kumasi")  # hosted by Gink: site.url
answer = client.chat("Make a habit tracker in React", gink_artifacts=True, gink_fit=True)
for a in client.artifacts(answer):                                     # page, react, chart, table, slides, image, ...
    open(a["filename"], "w").write(a["content"])
env = client.environments.get(it.environment)
print(env.download("report.md").decode())
```

Managed agents and environments: https://gink-server.onrender.com/developers/agents
