@omelhorsite/sdk 0.13.0 → 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 +26 -3
- package/dist/index.js +399 -170
- package/dist/types/auth/tokens.d.ts +1 -1
- package/dist/types/client.d.ts +3 -0
- package/dist/types/resources/admin/llm.d.ts +9 -1
- package/dist/types/resources/admin/quotas.d.ts +14 -0
- package/dist/types/resources/content/blogs.d.ts +111 -31
- package/dist/types/resources/content/index.d.ts +4 -4
- package/dist/types/resources/content/news/feeds.d.ts +56 -0
- package/dist/types/resources/content/news/index.d.ts +36 -0
- package/dist/types/resources/content/news/items.d.ts +115 -0
- package/dist/types/resources/content/{intel → news}/scripts.d.ts +35 -35
- package/dist/types/resources/content/{intel → news}/sources.d.ts +62 -59
- package/dist/types/resources/content/notifications.d.ts +2 -2
- package/dist/types/resources/cron.d.ts +209 -0
- package/dist/types/resources/index.d.ts +1 -0
- package/dist/types/resources/llm.d.ts +71 -0
- package/dist/types/resources/music/social.d.ts +121 -81
- package/dist/types/resources/music/songs.d.ts +39 -1
- package/dist/types/resources/quotas.d.ts +8 -5
- package/dist/types/resources/search.d.ts +36 -0
- package/package.json +1 -1
- package/dist/types/resources/content/intel/articles.d.ts +0 -230
- package/dist/types/resources/content/intel/config.d.ts +0 -135
- package/dist/types/resources/content/intel/index.d.ts +0 -53
- package/dist/types/resources/content/intel/items.d.ts +0 -91
- package/dist/types/resources/content/intel/reports.d.ts +0 -108
- package/dist/types/resources/content/intel/stats.d.ts +0 -105
- package/dist/types/resources/content/intel/types.d.ts +0 -86
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.
|
|
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` -
|
|
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.
|