first commit
This commit is contained in:
12
apps/sample_python/README.md
Normal file
12
apps/sample_python/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Sample Python Adapter
|
||||
|
||||
This directory shows the minimal shape expected by the `python` app adapter:
|
||||
|
||||
```python
|
||||
def run(question: str, **kwargs) -> dict:
|
||||
return {
|
||||
"answer": "...",
|
||||
"contexts": ["...", "..."],
|
||||
"raw_response": {...},
|
||||
}
|
||||
```
|
||||
14
apps/sample_python/adapter.py
Normal file
14
apps/sample_python/adapter.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def run(question: str, **kwargs) -> dict:
|
||||
answer = f"Sample adapter answer for: {question}"
|
||||
contexts = [
|
||||
"This is a local Python adapter example.",
|
||||
"Replace this with your real retrieval and generation logic.",
|
||||
]
|
||||
return {
|
||||
"answer": answer,
|
||||
"contexts": contexts,
|
||||
"raw_response": {"question": question, "kwargs": kwargs},
|
||||
}
|
||||
Reference in New Issue
Block a user