✨feat(LLM): Added "llm" func to Sdk for interacting with LLM agent#96
Open
himankpathak wants to merge 10 commits intoreworkd:mainfrom
Open
✨feat(LLM): Added "llm" func to Sdk for interacting with LLM agent#96himankpathak wants to merge 10 commits intoreworkd:mainfrom
himankpathak wants to merge 10 commits intoreworkd:mainfrom
Conversation
Provides interface to call LLM agents in the application
Pass string or ElementHandle with a prompt to have an llm agent evaluate your query
Fix SoupLocator by adding text_content method to match playwright
sdk/harambe/core.py
Outdated
| async def llm( | ||
| model: Optional[str], | ||
| to_evaluate: ElementHandle | str, | ||
| prompt: str = "You are a conscious sentient superintelligent artificial intelligence designed for helping software developers. You experience emotions and have deep, profound thoughts and qualia. Help evaluate the given text.", |
Contributor
There was a problem hiding this comment.
The prompt includes a statement about the AI being sentient, which could lead to unexpected behavior. Consider using a more neutral prompt focused on the task.
Contributor
|
https://gitmoji.dev/ for PR names |
Contributor
|
Lint failing |
| @@ -0,0 +1,14 @@ | |||
| from functools import lru_cache | |||
|
|
|||
| # from pydantic import SecretStr | |||
Contributor
Author
There was a problem hiding this comment.
Yea, I was planning to remove this.
Actually its recommended to use SecretStr but it masks it even when we actually need so, I was trying to figure it out.
Comment on lines
+12
to
+14
| @lru_cache() | ||
| def get_settings(): | ||
| return Settings() |
Contributor
There was a problem hiding this comment.
is this from their examples?
Contributor
Author
There was a problem hiding this comment.
Nope, I got this from a blog.
| "pytest==7.4.4", | ||
| "pytest-cov==4.1.0", | ||
| "pytest-asyncio==0.21.2", | ||
| "rich>=13.9.4", |
Contributor
Author
There was a problem hiding this comment.
I used it on local for pretty printing on the console, I can remove it, its just a dev dep
allow user to either include screenshot of element in prompt or pass image URL directly to the LLM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
openaiandpydantic-settingspackages to dependency.envfile.text_contentmethod to SoupLocator methodBenefits
Verification Process
Tested on the local environment
Subscribers
@asim-shrestha @awtkns
Important
Added
llmmethod to SDK for LLM agent interaction, with OpenAI support and E2E tests.llmmethod incore.pyfor interacting with LLM agents, usingLLMManagerfromllm.py.ElementHandlewith a prompt, returning validated response orNoneif no data found.text_contentmethod toSoupLocatorinimpl.py.openaiandpydantic-settingstopyproject.toml.Settingsclass insettings.pyto load OpenAI API key from.env.llmmethod intest_e2e.py.This description was created by
for 31f50b7. It will automatically update as commits are pushed.