fullstacked 0.12.0-1310 → 0.12.0-1316

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.
@@ -214,7 +214,7 @@ export function createConversation(opts: ConversationOptions) {
214
214
  const response = await chatModel.invoke([
215
215
  ...conversation,
216
216
  new HumanMessage(
217
- "Generate a title for this conversation with a 1 to 3 words.",
217
+ "Without thinking, generate a title for this conversation with a 1 to 3 words.",
218
218
  ),
219
219
  ]);
220
220
  return response.content
@@ -35,13 +35,19 @@ async function models(opts: ollama.Config) {
35
35
  return models.map((m) => m.name);
36
36
  }
37
37
 
38
+ function keyValueArrToObject(arr: [string, string][]) {
39
+ const obj = {};
40
+ arr.forEach(([key, value]) => (key ? (obj[key] = value) : null));
41
+ return obj;
42
+ }
43
+
38
44
  export function createOllama(opts?: typeof OllamaInfo.configs): Provider {
39
45
  const baseUrl =
40
46
  (opts?.find(({ id }) => id === "host")?.value as string) ||
41
47
  "http://localhost:11434";
42
- const headers =
43
- (opts?.find(({ id }) => id === "headers")?.value as {}) || {};
44
-
48
+ const headers = keyValueArrToObject(
49
+ (opts?.find(({ id }) => id === "headers")?.value as []) || [],
50
+ );
45
51
  return {
46
52
  models: () =>
47
53
  models({
@@ -144762,7 +144762,7 @@ function createConversation(opts) {
144762
144762
  const response = await chatModel.invoke([
144763
144763
  ...conversation,
144764
144764
  new HumanMessage(
144765
- "Generate a title for this conversation with a 1 to 3 words."
144765
+ "Without thinking, generate a title for this conversation with a 1 to 3 words."
144766
144766
  )
144767
144767
  ]);
144768
144768
  return response.content.toString().replace(/<think>(.|\s)*<\/think>\s*/g, "").replace(/(\*|\"|\')*/g, "").trim();
@@ -164185,9 +164185,16 @@ async function models2(opts) {
164185
164185
  const { models: models8 } = await ollamaClient.list();
164186
164186
  return models8.map((m) => m.name);
164187
164187
  }
164188
+ function keyValueArrToObject(arr2) {
164189
+ const obj = {};
164190
+ arr2.forEach(([key, value]) => key ? obj[key] = value : null);
164191
+ return obj;
164192
+ }
164188
164193
  function createOllama(opts) {
164189
164194
  const baseUrl = opts?.find(({ id: id4 }) => id4 === "host")?.value || "http://localhost:11434";
164190
- const headers = opts?.find(({ id: id4 }) => id4 === "headers")?.value || {};
164195
+ const headers = keyValueArrToObject(
164196
+ opts?.find(({ id: id4 }) => id4 === "headers")?.value || []
164197
+ );
164191
164198
  return {
164192
164199
  models: () => models2({
164193
164200
  host: baseUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fullstacked",
3
- "version": "0.12.0-1310",
3
+ "version": "0.12.0-1316",
4
4
  "scripts": {
5
5
  "build": "node build.js",
6
6
  "start": "npm run build && node index.js --lib ../../core/bin --root ~/FullStacked --config ~/.config/fullstacked --editor ../../out/editor",