Skip to content

Commit 7f615c8

Browse files
authored
fix: Handle whitespace in input (#17)
* fix: Handle empty space in input * fix: Add test for white-space in input field
1 parent ad77a66 commit 7f615c8

11 files changed

Lines changed: 7600 additions & 10 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## 0.2.6 (2025-08-15)
4+
5+
- Fix issue with whitespace in the input parameters.
36

47
## 0.2.5 (2025-02-12)
58

src/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
from apify import Actor
1010
from apify_client import ApifyClientAsync
1111
from openai import AsyncOpenAI
12+
from pydantic import ConfigDict
1213

1314
from .constants import OPENAI_SUPPORTED_FILES, OPENAI_VECTOR_STORE_POLLING_INTERVAL_MS
14-
from .input_model import OpenaiVectorStoreIntegration as ActorInput
15+
from .input_model import OpenaiVectorStoreIntegration
1516
from .utils import get_nested_value, split_data_if_required
1617

1718
if TYPE_CHECKING:
@@ -21,6 +22,10 @@
2122
from openai.types.file_object import FileObject
2223

2324

25+
class ActorInput(OpenaiVectorStoreIntegration):
26+
model_config = ConfigDict(str_strip_whitespace=True)
27+
28+
2429
async def main() -> None:
2530
async with Actor:
2631
payload = await Actor.get_input()

tests/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# -*- coding: utf-8 -*-
21

32
import sys
4-
53
from pathlib import Path
64

75
sys.path.insert(0, str(Path(__file__).parent.parent))

0 commit comments

Comments
 (0)