@omelhorsite/sdk 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -92,6 +92,27 @@ for await (const event of oms.llm.chats.send(chat.id, { content: "Olá!" })) {
92
92
  }
93
93
  ```
94
94
 
95
+ One answer from a model, for a program rather than a person:
96
+
97
+ ```ts
98
+ const answer = await oms.llm.complete({
99
+ messages: [
100
+ { role: "system", content: "Answer in one sentence." },
101
+ { role: "user", content: "What changed in Lisbon this week?" },
102
+ ],
103
+ tools: ["web_search", "read_url"],
104
+ });
105
+ answer.text; // the answer
106
+ answer.tool_calls; // the searches and pages the model used, in order
107
+ ```
108
+
109
+ Reading a web page the search returned:
110
+
111
+ ```ts
112
+ const hits = await oms.search.query({ q: "mesquita central lisboa", category: "news" });
113
+ const page = await oms.search.readPage({ url: hits.results[0]!.url });
114
+ ```
115
+
95
116
  An endpoint the SDK does not wrap yet:
96
117
 
97
118
  ```ts
@@ -107,10 +128,12 @@ const rows = await oms.http.get<{ id: string }[]>("/some/path");
107
128
  - `oms.music` - songs, artists, playlists, jams.
108
129
  - `oms.movies` - addons, collections, watch progress.
109
130
  - `oms.library` - books, shelves, annotations.
110
- - `oms.llm` - models and assistant chats.
111
- - `oms.search` - web, image, news and video search.
131
+ - `oms.llm` - models, one-shot completions and assistant chats.
132
+ - `oms.cron` - your TypeScript scripts run on a schedule by the server, with this SDK in scope; runs, logs and templates.
133
+ - `oms.search` - web, image, news and video search, and reading a page's text.
112
134
  - `oms.social` - direct messages, friends, group chats.
113
- - `oms.content` - blogs, notifications, feedback, site status. `oms.content.notifications.unsubscribe(token)` honours the link at the foot of a notification email and needs no credential.
135
+ - `oms.content.news` - news feeds: sources driven by scripts (RSS, Telegram, YouTube, a page with a selector), the items they produce, full-text search over them.
136
+ - `oms.content` - blogs (several per account, public, unlisted or private with invited members; `oms.content.blogs.own` manages them), notifications, feedback, site status. `oms.content.notifications.unsubscribe(token)` honours the link at the foot of a notification email and needs no credential.
114
137
  - `oms.tools` - media tools, each with its own daily quota.
115
138
  - `oms.jobs`, `oms.quotas` - background jobs and account limits.
116
139
  - `oms.tickets` - support tickets.