Skip to content

Commit

Permalink
fix names and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Oct 10, 2024
1 parent bdb2485 commit 45546c5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ continuing, for example it may want to execute code and look at the output befor
letting the user respond.

### Chatting and Artifacts
If you run `chat_with_code` you will also notice an `Artifact` object. `Artifact`'s
If you run `chat_with_artifacts` you will also notice an `Artifact` object. `Artifact`'s
are a way to sync files between local and remote environments. The agent will read and
write to the artifact object, which is just a pickle object, when it wants to save or
load files.
Expand All @@ -118,7 +118,7 @@ with open("image.png", "rb") as f:
artifacts["image.png"] = f.read()

agent = va.agent.VisionAgent()
response, artifacts = agent.chat_with_code(
response, artifacts = agent.chat_with_artifacts(
[
{
"role": "user",
Expand Down Expand Up @@ -298,11 +298,11 @@ mode by passing in the verbose argument:
```

### Detailed Usage
You can also have it return more information by calling `chat_with_workflow`. The format
You can also have it return more information by calling `generate_code`. The format
of the input is a list of dictionaries with the keys `role`, `content`, and `media`:

```python
>>> results = agent.chat_with_workflow([{"role": "user", "content": "What percentage of the area of the jar is filled with coffee beans?", "media": ["jar.jpg"]}])
>>> results = agent.generate_code([{"role": "user", "content": "What percentage of the area of the jar is filled with coffee beans?", "media": ["jar.jpg"]}])
>>> print(results)
{
"code": "from vision_agent.tools import ..."
Expand Down Expand Up @@ -331,7 +331,7 @@ conv = [
"media": ["workers.png"],
}
]
result = agent.chat_with_workflow(conv)
result = agent.generate_code(conv)
code = result["code"]
conv.append({"role": "assistant", "content": code})
conv.append(
Expand All @@ -340,7 +340,7 @@ conv.append(
"content": "Can you also return the number of workers wearing safety gear?",
}
)
result = agent.chat_with_workflow(conv)
result = agent.generate_code(conv)
```


Expand Down
12 changes: 6 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ continuing, for example it may want to execute code and look at the output befor
letting the user respond.

### Chatting and Artifacts
If you run `chat_with_code` you will also notice an `Artifact` object. `Artifact`'s
If you run `chat_with_artifacts` you will also notice an `Artifact` object. `Artifact`'s
are a way to sync files between local and remote environments. The agent will read and
write to the artifact object, which is just a pickle object, when it wants to save or
load files.
Expand All @@ -114,7 +114,7 @@ with open("image.png", "rb") as f:
artifacts["image.png"] = f.read()

agent = va.agent.VisionAgent()
response, artifacts = agent.chat_with_code(
response, artifacts = agent.chat_with_artifacts(
[
{
"role": "user",
Expand Down Expand Up @@ -294,11 +294,11 @@ mode by passing in the verbose argument:
```

### Detailed Usage
You can also have it return more information by calling `chat_with_workflow`. The format
You can also have it return more information by calling `generate_code`. The format
of the input is a list of dictionaries with the keys `role`, `content`, and `media`:

```python
>>> results = agent.chat_with_workflow([{"role": "user", "content": "What percentage of the area of the jar is filled with coffee beans?", "media": ["jar.jpg"]}])
>>> results = agent.generate_code([{"role": "user", "content": "What percentage of the area of the jar is filled with coffee beans?", "media": ["jar.jpg"]}])
>>> print(results)
{
"code": "from vision_agent.tools import ..."
Expand Down Expand Up @@ -327,7 +327,7 @@ conv = [
"media": ["workers.png"],
}
]
result = agent.chat_with_workflow(conv)
result = agent.generate_code(conv)
code = result["code"]
conv.append({"role": "assistant", "content": code})
conv.append(
Expand All @@ -336,7 +336,7 @@ conv.append(
"content": "Can you also return the number of workers wearing safety gear?",
}
)
result = agent.chat_with_workflow(conv)
result = agent.generate_code(conv)
```


Expand Down
4 changes: 2 additions & 2 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ def chat(
Returns:
List[Message]: The conversation response.
"""
return self.chat_and_artifacts(chat)[0]
return self.chat_with_artifacts(chat)[0]

def chat_and_artifacts(
def chat_with_artifacts(
self,
chat: List[Message],
artifacts: Optional[Artifacts] = None,
Expand Down

0 comments on commit 45546c5

Please sign in to comment.