Skip to content

Commit

Permalink
Documentation, __version__ to 0.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Feb 22, 2024
1 parent 32deacd commit dd47a76
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
4 changes: 3 additions & 1 deletion blendsql/blendsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ def blend(
_prev_passed_values: int = 0,
_prev_cleanup_tables: Set[str] = None,
) -> Smoothie:
"""Executes a BlendSQL query on a database given an ingredient context.
"""The `blend()` function is used to execute a BlendSQL query against a database and return the final result, in addition to the intermediate reasoning steps taken.
Execution is done on a database given an ingredient context.
Args:
query: The BlendSQL query to execute
Expand All @@ -298,6 +299,7 @@ def blend(
and put this in the `example_outputs` kwarg
table_to_title: Optional mapping from table name to title of table.
Useful for datasets like WikiTableQuestions, where relevant info is stored in table title.
Returns:
smoothie: Smoothie dataclass containing pd.DataFrame output and execution metadata
"""
Expand Down
11 changes: 3 additions & 8 deletions blendsql/db/sqlite_db_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@
@attrs(auto_detect=True)
class SQLiteDBConnector:
"""
Method to connect to db which also has some utility ingredients.
Class used to connect to a SQLite database.
Parameter
---------
path : str
Path of the db
db : str
File name of the db
Args:
db_path: Path to the db
"""

db_path: str = attrib()
Expand Down
1 change: 1 addition & 0 deletions blendsql/llms/remote/_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def _load_model(self) -> Model:
self.model_name_or_path,
api_key=os.getenv("OPENAI_API_KEY"),
azure_endpoint=os.getenv("OPENAI_API_BASE"),
azure_deployment=os.getenv("API_VERSION"),
echo=False,
)

Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ hide:
</div>
<br/>

```bash
pip install blendsql
```

BlendSQL is a *superset of SQLite* for problem decomposition and hybrid question-answering with LLMs. It builds off of the syntax of SQL to create an intermediate representation for tasks requiring complex reasoning over both structured and unstructured data.

It can be viewed as an inversion of the typical text-to-SQL paradigm, where a user calls a LLM, and the LLM calls a SQL program.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/blenders/blenders.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We use the term "blender" to describe the LLM which receives the prompts used to perform each ingredient function within a BlendSQL script.

We enable integration with many existing LLMs by building on top of `guidance` models: https://github.com/guidance-ai/guidance?tab=readme-ov-file#loading-models
We enable integration with many existing LLMs by building on top of [`guidance` models](https://github.com/guidance-ai/guidance?tab=readme-ov-file#loading-models).

Certain models may be better geared towards some BlendSQL tasks than others, so choose carefully!

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/reference/databases/sqlite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SQLite

::: blendsql.db.sqlite_db_connector.SQLiteDBConnector
handler: python
show_source: true
13 changes: 9 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,24 @@ plugins:
python:
options:
show_submodules: true
show_source: true
docstring_style: google
docstring_section_style: table
show_docstring_examples: true
show_symbol_type_heading: true
- search
- section-index

nav:
- Home:
- index.md
- Home: index.md
- Examples from QA Datasets:
- HybridQA: examples/hybridqa.md
- OTT-QA: examples/ottqa.md
- FEVEROUS: examples/feverous.md
- FAQ: faq.md
- Getting Started:
- Installation: installation.md
- Quickstart: quickstart.md
- FAQ: faq.md
- Documentation:
- Execute a BlendSQL Query: reference/execute-blendsql.md
- Ingredients:
Expand All @@ -60,5 +64,6 @@ nav:
- reference/blenders/blenders.md
- OpenAI: reference/blenders/openai.md
- Transformers: reference/blenders/transformers.md
- Databases: reference/databases.md
- Databases:
- SQLite: reference/databases/sqlite.md
- Technical Walkthrough: reference/technical_walkthrough.md

0 comments on commit dd47a76

Please sign in to comment.