Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Langfun is *simple and elegant*:
* An intuitive programming model, graspable in 5 minutes;
* Plug-and-play into any Python codebase, making an immediate difference;
* Comprehensive LLMs under a unified API: Gemini, GPT, Claude, Llama3, and more.
* Designed for agile developement: offering intellisense, easy debugging, with minimal overhead;
* Designed for agile development: offering intellisense, easy debugging, with minimal overhead;

## Hello, Langfun

Expand Down
9 changes: 5 additions & 4 deletions langfun/core/agentic/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,11 @@ def append(self, item: TracedItem) -> None:

def remove(self, item: TracedItem) -> None:
"""Removes an item from the sequence."""
index = self.items.index(item)
if index == -1:
raise ValueError(f'Item not found in execution trace: {item!r}')

try:
index = self.items.index(item)
except ValueError as exc:
raise ValueError(f'Item not found in execution trace: {item!r}') from exc

with pg.notify_on_change(False):
self.items.pop(index)

Expand Down