dendrite-python-sdk icon indicating copy to clipboard operation
dendrite-python-sdk copied to clipboard

Fields has been removed

Open tylerdurden4285 opened this issue 10 months ago • 0 comments
trafficstars

from dendrite import Dendrite
from dendrite.logic.llm.agent import LLM
from dendrite.logic.llm.config import LLMConfig
from dendrite.logic.config import Config
from time import sleep

# Create custom configurations for all agents to use GPT-4
custom_agents = {
    "extract_agent": LLM("gpt-4", temperature=0.2),
    "scroll_agent": LLM("gpt-4", temperature=0.2),
    "ask_page_agent": LLM("gpt-4", temperature=0.2),
    "segment_agent": LLM("gpt-4", temperature=0.2),
    "select_agent": LLM("gpt-4", temperature=0.2),
    "verify_action_agent": LLM("gpt-4", temperature=0.2)
}

# Initialize config with custom agents
llm_config = LLMConfig(default_agents=custom_agents)
config = Config(llm_config=llm_config)

# Use in Dendrite initialization
browser = Dendrite(config=config)


def main():
    browser.goto("https://google.com")
    sleep(2)
    browser.fill("Search field", "Hello world")
    browser.press("Enter")
    print("completed")

if __name__ == "__main__":
    main()

python google_hello_world.py

Runs successfully but I get this warning about field. what to do about this? I looked in docs but didn't see the new recommendation for it.

py:341: UserWarning: Valid config keys have changed in V2:
* 'fields' has been removed
  warnings.warn(message, UserWarning)
 12:27:26.577 | INFO     | Going to https://google.com
 12:27:29.032 | INFO     | Getting element for prompt: 'Search field

Make sure the element can be filled with text.'
 12:27:29.059 | DEBUG    | Attempting to use cached selectors with backoff
completed

tylerdurden4285 avatar Jan 09 '25 04:01 tylerdurden4285