Skip to content

Commit

Permalink
custom guide
Browse files Browse the repository at this point in the history
  • Loading branch information
lyie28 committed May 21, 2024
1 parent 7300e84 commit 9b3dd88
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/docs/get-started/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

Our Web Agents have the following modifiable elements:

- `llm`: The `LLM` used by the `Action Engine` to translate text instructions into automation code. You can set the `llm` to any `LlamaIndex LLM object`.
- `llm`: The `LLM` used by the `Action Engine` to translate text instructions into automation code. You can set the `llm` to any `LlamaIndex LLM object`.

- `mm_llm`: The `multi-modal LLM` used by the `World Model` to generate the next instruction to be enacted by the Action Engine based on the current state of the web page. You can set the `mm_llm` argument to any `LlamaIndex LLM object`.
- `mm_llm`: The `multi-modal LLM` used by the `World Model` to generate the next instruction to be enacted by the Action Engine based on the current state of the web page. You can set the `mm_llm` argument to any `LlamaIndex LLM object`.

- `embedding`: The `embedding model` is used by the `retriever` to convert segments of the HTML page of the target website into vectors, capturing semantic meaning. You can set this to any `LlamaIndex Embedding object`.
- `embedding`: The `embedding model` is used by the `retriever` to convert segments of the HTML page of the target website into vectors, capturing semantic meaning. You can set this to any `LlamaIndex Embedding object`.

- `retriever`: The `retriever` is used within the `Action Model` to retrieve the most relevant HTML source code of the webpage to be able to generate the automation code targetting HTML elements. This can be any `LlamaIndex.retriever`.
- `retriever`: The `retriever` is used within the `Action Model` to retrieve the most relevant HTML source code of the webpage to be able to generate the automation code targetting HTML elements. This can be any `LlamaIndex.retriever`.

- `prompt_template`: The prompt template used by the `Action Engine` to query the `LLM` in order to generate automation code for an instruction. You can replace this with your own prompt template as a string.
- `prompt_template`: The prompt template used by the `Action Engine` to query the `LLM` in order to generate automation code for an instruction. You can replace this with your own prompt template as a string.

- `extractor`: The `cleaning function` applied to the automation code generated by the LLM in the `Action Engine`. You can replace this with your own custom method as a callable.
- `extractor`: The `cleaning function` applied to the automation code generated by the LLM in the `Action Engine`. You can replace this with your own custom method as a callable.

These elements are initialized in a `Context` object, which can optionally passed to both the `Action Engine` and `World Model` used by an Agent. If you don't pass them your own Context object, the default OpenaiContext will be used.

??? note "Default Configuration"

The default configuration is as follows:

- `llm`: OpenAI's gpt-3.5-turbo,
- `mm_llm`: OpenAi's gpt-4o,
- `embedding`: text-embedding-3-large,
Expand All @@ -30,7 +31,7 @@ These elements are initialized in a `Context` object, which can optionally passe

Let's take a look at how we can modify specific elements of an existing built-in Context.

Example: Modifying an OpenaiContext
#### Example: Modifying a built in context

```code
python
Expand Down Expand Up @@ -66,7 +67,7 @@ Here, we modify the default `OpenaiContext` by replacing its LLM, multi-modal LL

## Creating a Context object from scratch

Alternative, you can create a `Context` from scratch by initializing a `lavague.core.Context` and providing all the Context arguments: `llm`, `mm_llm`, `embedding`, `retriever`, `prompt_template` & `extractor`.
Alternative, you can create a `Context` from scratch by initializing a `lavague.core.Context` object and providing all the Context arguments: `llm`, `mm_llm`, `embedding`, `retriever`, `prompt_template` & `extractor`.

## Summary

Expand Down

0 comments on commit 9b3dd88

Please sign in to comment.