explosion / explosion/spacy-llm
Support one doc to many prompts?
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
Is there a way to send multiple LLM requests for a given document? For example, say I have an earlier pipeline step that identifies individual spans that should be labelled by a LLM.
Looking at the API:
```py
def generate_prompts(self, docs: Iterable[Doc]) -> Iterable[str]:
...
def parse_responses(self, docs: Iterable[Doc], responses: Iterable[str]) -> Iterable[Doc]:
...
```
It could maybe be:
```py
def generate_prompts(self, docs: Iterable[Doc]) -> Iterable[(Doc, Prompt, UserContext)]:
...
def parse_responses(self, responses: Iterable[(Doc, Prompt, UserContext, Response)]):
...
```
To allow the user to produce multiple prompts and attach metadata for identification later.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the generate_prompts and parse_responses API shown in the issue and the surrounding pipeline design. Clarify how multiple prompts per document and identification metadata should be represented, then define the compatibility and parsing requirements. Done means the API supports multiple requests for one document with enough context to associate each response correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100