diff --git a/docs/assets/trajectory-export.png b/docs/assets/trajectory-export.png new file mode 100644 index 00000000..08bbf265 Binary files /dev/null and b/docs/assets/trajectory-export.png differ diff --git a/docs/assets/trajectory.png b/docs/assets/trajectory.png new file mode 100644 index 00000000..42d105e6 Binary files /dev/null and b/docs/assets/trajectory.png differ diff --git a/docs/docs/get-started/quick-tour.md b/docs/docs/get-started/quick-tour.md index 0e3fcfd7..2bc28e93 100644 --- a/docs/docs/get-started/quick-tour.md +++ b/docs/docs/get-started/quick-tour.md @@ -77,7 +77,7 @@ First of all, we need to get our `trajectory`, or series of actions, correspondi To do this, we initialize a WebAgent and give it an objective of testing a natural language `scenario`. ```python -from lavague.core.agents import WebAgent +from lavague import WebAgent # Create Web Agent agent = WebAgent(api_key="") diff --git a/docs/docs/learn/trajectory.md b/docs/docs/learn/trajectory.md index e69de29b..73910971 100644 --- a/docs/docs/learn/trajectory.md +++ b/docs/docs/learn/trajectory.md @@ -0,0 +1,21 @@ +# Trajectories + +Trajectories are classes returned by LaVague agents containing information about an agent run and the list of actions performed. + +They contain the following attributes: +- `start_url`: The URL provided as input for this run +- `objective`: The text objective that was given as input for this run +- `run_id`: A unique run id +- `output`: Text output where expected +- `actions`: The series of [actions](./actions.md) generated during this run +- `status`: Whether the agent run was `completed` or `failed` + +![trajectory](https://raw.githubusercontent.com/lavague-ai/LaVague/drafting-some-docs/docs/assets/trajectory.png) + +## Integrations + +This Trajectory can be passed to `exporter` functions to be converted into replayable automation code in the format required your use case. + +![exporter](https://raw.githubusercontent.com/lavague-ai/LaVague/drafting-some-docs/docs/assets/trajectory-export.png) + +Currently, we only provide a `PyTest exporter`, but we plan to work with the community to build exporters to cover a wide range of use cases. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 39d5725f..f62a7346 100644 --- a/docs/index.md +++ b/docs/index.md @@ -60,11 +60,11 @@ pip install lavague You're now ready to start using LaVague Web Agents to perform tasks on the websites of your choice: ```python -from lavague.core.agents import WebAgent +from lavague import WebAgent url = "https://huggingface.co/" -objective = "Return a list of the top 5 trending models on HuggingFace" -agent = WebAgent() +obj = "Return a list of the top 5 trending models on HuggingFace" +agent = WebAgent(api_key="") ret = agent.run(url=url, objective=obj) # Print output