Skip to content

Commit

Permalink
chore: move configuration to alembic package
Browse files Browse the repository at this point in the history
  • Loading branch information
Askir committed Jan 7, 2025
1 parent 1c43792 commit 7b90575
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/python-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Then you can use the `create_vectorizer` operation to create a vectorizer for yo

```python
from alembic import op
from pgai.vectorizer.configuration import (
from pgai.alembic.configuration import (
OpenAIConfig,
CharacterTextSplitterConfig,
PythonTemplateConfig
Expand Down
4 changes: 4 additions & 0 deletions projects/extension/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ WORKDIR /pgai
COPY . .
RUN just build install

RUN mkdir -p /docker-entrypoint-initdb.d && \
echo "#!/bin/bash" > /docker-entrypoint-initdb.d/configure-timescaledb.sh && \
echo "echo \"shared_preload_libraries = 'timescaledb'\" >> \${PGDATA}/postgresql.conf" >> /docker-entrypoint-initdb.d/configure-timescaledb.sh && \
chmod +x /docker-entrypoint-initdb.d/configure-timescaledb.sh

###############################################################################
# image for use in extension development
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion projects/pgai/pgai/alembic/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sqlalchemy import text
from typing_extensions import override

from pgai.vectorizer.configuration import (
from pgai.alembic.configuration import (
CharacterTextSplitterConfig,
ChunkValueConfig,
CreateVectorizerParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Create Date: {create_date}
from alembic import op
from sqlalchemy import Column, Integer, String, Text
from sqlalchemy import text
from pgai.vectorizer.configuration import (
from pgai.alembic.configuration import (
OpenAIConfig,
OllamaConfig,
VoyageAIConfig,
Expand Down
4 changes: 2 additions & 2 deletions projects/pgai/tests/vectorizer/extensions/test_alembic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
If you add new configuration options, add a test for them here.
Either in an existing test case or a new one.
The config classes for migrations lie in pgai/vectorizer/configuration.py
The config classes for migrations lie in pgai/alembic/configuration.py
If the migration and the validation definitions overlap,
it is possible to define a parent class in base.py
see e.g. CharacterTextSplitterConfig as an example
Expand All @@ -22,7 +22,7 @@
from alembic.config import Config
from sqlalchemy import Engine, text

from pgai.vectorizer.configuration import (
from pgai.alembic.configuration import (
CharacterTextSplitterConfig,
HNSWIndexingConfig,
OllamaConfig,
Expand Down

0 comments on commit 7b90575

Please sign in to comment.