arakoodev / EdgeChains

EdgeChains.js Typescript/Javascript production-friendly Generative AI. Based on Jsonnet. Works anywhere that Webassembly does. Prompts live declaratively & "outside code in config". Kubernetes & edge friendly. Compatible with OpenAI GPT, Gemini, Llama2, Anthropic, Mistral and others
https://www.arakoo.ai/
GNU Affero General Public License v3.0
345 stars 69 forks source link

BOUNTY: add support for playwright (using jsonnet) for RPA using GPT #280

Closed sandys closed 9 months ago

sandys commented 10 months ago

generative AI can be used to do some automation activities - what is called as RPA. Some examples are like what robocorp does - https://robocorp.com/portal/robot/robocorp/example-chatgpt-xpath-guesser-assistant https://robocorp.com/portal/robot/ekipalen/RPA.OpenAI-Triviaplaza

we want similar functionality in Edgechains.js (javascript SDK - https://github.com/arakoodev/EdgeChains/tree/ts/JS/edgechains ) using https://playwright.dev/ SDK. We use jsonnet to setup configuration for chatgpt/gpt api. for example we give prompts and even execute loops using jsonnet - https://github.com/arakoodev/EdgeChains/blob/main/Examples/react-chain/react-chain.jsonnet jsonnet is a well known configuration language - https://jsonnet.org/

this project will be deemed complete if:

  1. you are able to give a declarative configuration in a jsonnet file on the activities to be performed (including xpaths, what buttons to be clicked, etc etc)
  2. edgechains.js executes those actions using playwright.dev sdk.
  3. the example to get working is the same as above ( https://robocorp.com/portal/robot/robocorp/example-chatgpt-xpath-guesser-assistant and https://robocorp.com/portal/robot/ekipalen/RPA.OpenAI-Triviaplaza)
sandys commented 10 months ago

/bounty 100

algora-pbc[bot] commented 10 months ago

💎 $100 bounty created by sandys 🙋 If you start working on this, comment /attempt #280 to notify everyone 👉 To claim this bounty, submit a pull request that includes the text /claim #280 somewhere in its body 📝 Before proceeding, please make sure you can receive payouts in your country 💵 Payment arrives in your account 2-5 days after the bounty is rewarded 💯 You keep 100% of the bounty award 🙏 Thank you for contributing to arakoodev/EdgeChains!

Attempt Started (GMT+0) Solution
🔴 @haruncurak Nov 30, 2023, 12:56:28 PM WIP
haruncurak commented 10 months ago

Very happy to work on this one! Could you assign me? /attempt #280

Options
sandys commented 10 months ago

@haruncurak just double checking that you would be comfortable to execute this bounty - since this is in typescript ? playwright.dev is a headless browser runner, etc is this something you feel comfortable pulling off ?

Gmin2 commented 10 months ago

@sandys can i take this?

sandys commented 10 months ago

@Min2who ur assigned to https://github.com/arakoodev/EdgeChains/issues/279 . if u want to take this, ull need to drop that one.

haruncurak commented 10 months ago

Hey @sandys, yeah! Got TS experience under my belt, looking through the codebase atm.

Gmin2 commented 10 months ago

go ahead @haruncurak

sandys commented 10 months ago

@haruncurak assigned to you. if at any moment, u want to change that...please comment here.

sandys commented 10 months ago

@haruncurak if u need to discuss, please feel free to jump into discord. https://discord.gg/ZXahYqQE

haruncurak commented 10 months ago

Oops removed assign by accident

sandys commented 10 months ago

@haruncurak need any help ?

haruncurak commented 10 months ago

Hey @sandys I'll let you know! Currently prototyping. One question I do have is about where you want this stuff to be - I was thinking to create 2 more examples in the examples folder with the Playwright integration.

sandys commented 10 months ago

@haruncurak so ur right that the examples folder is the right place for examples. but since this is being driven using jsonnet configuration, i have a feeling u will need to create some core classes to add support. that will go inside the edgechains lib.

haruncurak commented 10 months ago

Understood. I've been able to get it working without having to add additional core classes with the following JSONNET. Do you have any more specific ideas for what kinds of core classes you think might be needed?


{
  url: "https://www.triviaplaza.com/king-arthur-quiz/",
  playButtonSelector: "//a[contains(text(),'Play')]",
  questionSelector: "//div[@id='ques']",
  answerSelectors: {
    "A": "//div[@id='b1']",
    "B": "//div[@id='b2']",
    "C": "//div[@id='b3']",
    "D": "//div[@id='b4']"
  },
  maxQuestions: 10,
  gptModel: "gpt-3.5-turbo",

  // Custom prompt template for the quiz
  quizPromptTemplate: |||
    Given the following question and multiple-choice answers, determine the most likely correct answer.
    Question: {}
    A: {}
    B: {}
    C: {}
    D: {}
    The most likely correct answer is:
  |||,
}
sandys commented 10 months ago

that is great to know. however edgechains is a dev tool SDK. the idea is for you to let others create these kind of flows very easily. so we need the jsonnet integration (as was mentioned in the first part of the issue).

secondly the playwright code will be driven by generative ai (which is the openai integration we already have)

you seem to have built a demo application of pure playwright. that does not solve the problem of our integration needs as party of this bounty :(

On Mon, Dec 4, 2023 at 12:44 AM haruncurak @.***> wrote:

Understood. I've been able to get it working without having to add additional core classes with the following JSONNET. Do you have any more specific ideas for what kinds of core classes you think might be needed? Screenshot.2023-12-03.at.8.12.45.PM.png (view on web) https://github.com/arakoodev/EdgeChains/assets/53381119/1b070b01-6a57-4fb6-9b6a-c51dacf12dc1

— Reply to this email directly, view it on GitHub https://github.com/arakoodev/EdgeChains/issues/280#issuecomment-1837572598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASYU5D6254ZZA2FLLOJ7LYHTFQRAVCNFSM6AAAAABABBOSOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGU3TENJZHA . You are receiving this because you were mentioned.Message ID: @.***>

haruncurak commented 10 months ago

Ah understood, thanks for explaining what you meant @sandys. I think I'll be a bit pressed for time over the next couple of days so feel free to assign this to @Min2who or others who might be interested. Dropping it for now - sorry about that.

sandys commented 10 months ago

@haruncurak acknowledged. please cancel ur attempt (using the link in https://github.com/arakoodev/EdgeChains/issues/280#issuecomment-1833737867) so others can pick up

haruncurak commented 10 months ago

Done, thanks!

sandys commented 9 months ago

bounty closed and assigned separately.