sliftutils 1.0.1 → 1.0.4

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/index.d.ts CHANGED
@@ -100,6 +100,9 @@ declare module "sliftutils/misc/openrouter" {
100
100
  onCost?: (cost: number) => void;
101
101
  validate?: (response: T) => void;
102
102
  }): Promise<T>;
103
+ export declare function simpleAICall(model: string, message: string): Promise<string>;
104
+ /** The message must request the result to be returned in YAML (we automatically parse this and return an object). */
105
+ export declare function simpleAICallTyped<T>(model: string, message: string): Promise<T>;
103
106
  export declare function openRouterCall(config: {
104
107
  model: string;
105
108
  messages: MessageHistory;
@@ -28,6 +28,9 @@ export declare function yamlOpenRouterCall<T>(config: {
28
28
  onCost?: (cost: number) => void;
29
29
  validate?: (response: T) => void;
30
30
  }): Promise<T>;
31
+ export declare function simpleAICall(model: string, message: string): Promise<string>;
32
+ /** The message must request the result to be returned in YAML (we automatically parse this and return an object). */
33
+ export declare function simpleAICallTyped<T>(model: string, message: string): Promise<T>;
31
34
  export declare function openRouterCall(config: {
32
35
  model: string;
33
36
  messages: MessageHistory;
@@ -52,6 +52,20 @@ export async function yamlOpenRouterCall<T>(config: {
52
52
  }
53
53
  }
54
54
 
55
+ export async function simpleAICall(model: string, message: string): Promise<string> {
56
+ return await openRouterCallBase({
57
+ model,
58
+ messages: [{ role: "user", content: message }],
59
+ });
60
+ }
61
+ /** The message must request the result to be returned in YAML (we automatically parse this and return an object). */
62
+ export async function simpleAICallTyped<T>(model: string, message: string): Promise<T> {
63
+ return await yamlOpenRouterCall({
64
+ model,
65
+ messages: [{ role: "user", content: message }],
66
+ }) as T;
67
+ }
68
+
55
69
  let pendingLog: {
56
70
  count: number;
57
71
  duration: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -25,7 +25,8 @@ export class Anchor extends preact.Component<{
25
25
  <a
26
26
  {...remaining}
27
27
  className={
28
- css.textDecoration("none")
28
+ "Anchor "
29
+ + css.textDecoration("none")
29
30
  .opacity(0.8, "hover")
30
31
  + (selected && css.color("hsl(110, 75%, 65%)", "soft"))
31
32
  + (!selected && css.color("hsl(210, 75%, 65%)", "soft"))
package/web/Page.tsx CHANGED
@@ -48,7 +48,7 @@ export class Page extends preact.Component {
48
48
 
49
49
  return (
50
50
  <div className={css.size("100vw", "100vh").vbox(0)}>
51
- <div className={css.hbox(12).pad2(20, 0)}>
51
+ <div className={css.hbox(12).pad2(20, 10).paddingBottom(5, "important")}>
52
52
  {pages.map(p => (
53
53
  <Anchor key={p.key} params={[[pageURL, p.key]]}>
54
54
  {p.key}
package/web/browser.tsx CHANGED
@@ -6,7 +6,7 @@ import { list } from "socket-function/src/misc";
6
6
  import { enableHotReloading } from "../builders/hotReload";
7
7
  import { URLParam } from "../render-utils/URLParam";
8
8
  import { Page } from "./Page";
9
- import { configureMobxNextFrameScheduler } from "sliftutils/render-utils/mobxTyped";
9
+ import { configureMobxNextFrameScheduler } from "../render-utils/mobxTyped";
10
10
 
11
11
 
12
12
  async function main() {
package/web/index.html CHANGED
@@ -23,6 +23,9 @@
23
23
  margin: 0px;
24
24
  padding: 0px;
25
25
  }
26
+ a:not(.Anchor), a:visited:not(.Anchor) {
27
+ color: hsl(210, 75%, 65%);
28
+ }
26
29
  </style>
27
30
  </head>
28
31
  <body>