screenpipe icon indicating copy to clipboard operation
screenpipe copied to clipboard

Add SmartTrend pipe

Open giraffekey opened this issue 10 months ago • 46 comments

SmartTrend is a pipe created for the Developer Program that acts as a Twitter engagement assistant that finds relevant tweets and suggests replies to help the user engage more easily.

https://github.com/user-attachments/assets/74dcc66d-c244-48b8-a5fd-63c8df113b01

/claim #1191 /closes #1191

giraffekey avatar Feb 17 '25 04:02 giraffekey

@giraffekey is attempting to deploy a commit to the louis030195's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 17 '25 04:02 vercel[bot]

https://cap.so/s/d55sm9sy0vqd1hs

louis030195 avatar Feb 17 '25 20:02 louis030195

I think this is an issue with different setups. I tried running the linkedin ai assistant to see how it works and got the error:

[chrome-route] chrome launch failed with error: Error: failed to connect to chrome debug port after all attempts

Mine works if you install puppeteer with npm i puppeteer, but I don't think that's very portable. I'm not sure how to automate these installations.

giraffekey avatar Feb 17 '25 21:02 giraffekey

I added a button that installs Chrome before the Connect button is enabled.

giraffekey avatar Feb 18 '25 06:02 giraffekey

https://cap.so/s/zrs787221s3qv6f

louis030195 avatar Feb 18 '25 17:02 louis030195

not enough user feedback, please show what the bot is doing, like write some status text idk

does not work in general, waited a bit, nothing happen

https://cap.so/s/n1mn2yxspxehbgq

louis030195 avatar Feb 18 '25 17:02 louis030195

Should now connect to the already running browser instance instead of downloading Chrome for Testing. Added status text for the processes and toasts for any caught errors.

giraffekey avatar Feb 19 '25 10:02 giraffekey

Screenshot 2025-02-19 at 10 07 46 AM

1 does not compile

2

Error: dlopen(/Users/louisbeaumont/.screenpipe/pipes/smarttrend/node_modules/lmdb/build/Release/lmdb.node, 0x 0001): tried: '/Users/louisbeaumont/.screenpipe/pipes/smarttrend/node_modules/lmdb/build/Release/lmdb.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/louisbeaumont/.screenpipe/pipes/smarttrend/node_modules/lmdb/build/Release/lmdb.node' (no such file), '/Users/louisbeaumont/.scr eenpipe/pipes/smarttrend/node_modules/lmdb/build/Release/lmdb.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

Screenshot 2025-02-19 at 10 07 35 AM

louis030195 avatar Feb 19 '25 18:02 louis030195

Should be fixed.

giraffekey avatar Feb 19 '25 23:02 giraffekey

https://cap.so/s/ds7rtm2rs18vwp3

does not work

louis030195 avatar Feb 19 '25 23:02 louis030195

It can only connect to Chrome if the remote debugging port is open. Added code to open chrome with the correct args.

giraffekey avatar Feb 20 '25 00:02 giraffekey

https://cap.so/s/kgkb08pphckkebq

louis030195 avatar Feb 20 '25 00:02 louis030195

The only time it fails silently like that is when the AI model can't be detected.

It should work correctly with aiProviderType set to "openai" and openaiApiKey being set. It's also supposed to work with Ollama.

giraffekey avatar Feb 20 '25 01:02 giraffekey

https://cap.so/s/wn5pt3tgv6y2n0v

louis030195 avatar Feb 20 '25 01:02 louis030195

It turns out screenpipe cloud works differently than other OpenAI providers. I'm not able to use the ai crate's streamText and streamObject functions with it. I've implemented a fix to make text streaming work by parsing the errors, but streaming structured data is still only working with the normal OpenAI provider, which means tweet suggestions are not currently working.

giraffekey avatar Feb 20 '25 03:02 giraffekey

This code works with openai.com but does not work with screenpipe cloud:

import { streamObject } from "ai";
import { z } from "zod";

const schema = z.object({
  tweetId: z.string(),
  handle: z.string(),
  reason: z.string(),
  reply: z.string(),
});
const { elementStream } = await streamObject({
  model,
  output: "array",
  schema,
  prompt: "...",
});

giraffekey avatar Feb 20 '25 03:02 giraffekey

It should work with screenpipe cloud now, but it might sometimes fail if the AI returns incorrect schema, since it doesn't support object streaming.

giraffekey avatar Feb 20 '25 10:02 giraffekey

It should work with screenpipe cloud now, but it might sometimes fail if the AI returns incorrect schema, since it doesn't support object streaming.

you mean screenpipe-cloud does not support object streaming?

@Gmin2 can you fix that? will give tip

louis030195 avatar Feb 20 '25 16:02 louis030195

https://cap.so/s/1s3zr27j73w9ek5

thats great, starts to become rly good, few issues:

  • it grab focus on the chrome window and distract me from work, usually the linkedin agent was properly acting in background completely?
  • click on post does not find the tweet many times
  • stop bot does not do anything or there is no user feedback (need loading or something) and is slow
  • maybe need more settings on frequency, time, etc.
  • should let me give system prompt and/or use my style from usual x replies

logs

Screenshot 2025-02-20 at 8 59 39 AM

ill try to use more daily to see if it's useful

louis030195 avatar Feb 20 '25 17:02 louis030195

@Gmin2 can you fix that? will give tip

sure @louis030195 , can yu share the output when yu run screenpipe cloud with strucctured outputs(cc @giraffekey )

Gmin2 avatar Feb 20 '25 17:02 Gmin2

@Gmin2 can you fix that? will give tip

sure @louis030195 , can yu share the output when yu run screenpipe cloud with strucctured outputs(cc @giraffekey )

It doesn't give output. What happens is it hangs for a while, then stops the stream without having ever returned anything. When I use generateObject instead of streamObject I get a "max retries reached" error. Maybe it's trying to call an endpoint that doesn't exist.

giraffekey avatar Feb 21 '25 01:02 giraffekey

It doesn't give output. What happens is it hangs for a while, then stops the stream without having ever returned anything. When I use generateObject instead of streamObject I get a "max retries reached" error. Maybe it's trying to call an endpoint that doesn't exist.

Investigating 🕵️

Gmin2 avatar Feb 21 '25 08:02 Gmin2

any update on this?

would it make sense to merge a first version in coming days for part of the bounty and iterate from user feedback?

louis030195 avatar Feb 26 '25 03:02 louis030195

I'm ready for merge. I consider the first version of this already complete (unless there's any more caveats).

giraffekey avatar Feb 26 '25 04:02 giraffekey

https://cap.so/s/wnpy118svjrdznq

does not work

louis030195 avatar Feb 26 '25 21:02 louis030195

https://cap.so/s/wnpy118svjrdznq

does not work

Does screenpipe cloud w/ gpt-4 work?

giraffekey avatar Feb 27 '25 00:02 giraffekey

i used openai directly

louis030195 avatar Feb 27 '25 16:02 louis030195

Hm. Both are working for me.

giraffekey avatar Feb 27 '25 16:02 giraffekey

I don't think I changed any of the API model code since the last time you ran it.

giraffekey avatar Feb 27 '25 16:02 giraffekey

I fixed something but I doubt it was related.

giraffekey avatar Feb 27 '25 17:02 giraffekey