Skip to content

Implement Examples from AppAgent and Verify If It Works #11

@EugeneVuong

Description

@EugeneVuong
  1. Go to Find a Task in the AppAgent
  2. Copy the State Prompt of the Said Task
  3. Create a New File with the same name as the task in the NetGent Repo (Ensure that the file is in the right folder (conference, streaming, and browsing)
import json
from netgent import NetGent, StatePrompt
from langchain_google_vertexai import ChatVertexAI
from langchain_google_genai import ChatGoogleGenerativeAI
from dotenv import load_dotenv
load_dotenv()
agent = NetGent(llm=ChatVertexAI(model="gemini-2.0-flash-exp", temperature=0.2), llm_enabled=True, user_data_dir="examples/user_data")
prompt = [
        <Add State Prompt Here>
    ]

try:
    with open("examples/<Task Label>/results/<Name of Task>_result.json", "r") as f:
        result = json.load(f)
except FileNotFoundError:
    result = []

result = agent.run(state_prompts=prompt, state_repository=result)

input("Press Enter to continue...")
with open("examples/<Task Label>/results/<Name of Task>.json", "w") as f:
    json.dump(result["state_repository"], f, indent=2)
  1. Run the action to see if it works and generate the result JSON in the correct folder.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions