stores 0.1.7.dev4__tar.gz → 0.1.7.dev6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/PKG-INFO +1 -1
  2. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/pyproject.toml +1 -1
  3. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/run_browser_use.py +7 -3
  4. stores-0.1.7.dev6/run_sandbox.py +24 -0
  5. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/indexes/venv_utils.py +38 -10
  6. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/uv.lock +1 -1
  7. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/.gitignore +0 -0
  8. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/.python-version +0 -0
  9. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/LICENSE +0 -0
  10. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/README.md +0 -0
  11. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/README.md +0 -0
  12. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/anthropic_api.py +0 -0
  13. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/google_gemini_auto_call.py +0 -0
  14. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/google_gemini_manual_call.py +0 -0
  15. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/langchain_w_tool_calling.py +0 -0
  16. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/langgraph_agent.py +0 -0
  17. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/litellm_w_tool_calling.py +0 -0
  18. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/llamaindex_agent.py +0 -0
  19. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/openai_agent.py +0 -0
  20. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/openai_chat_completions.py +0 -0
  21. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/examples/quickstarts/openai_responses.py +0 -0
  22. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/local_generator.py +0 -0
  23. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/run_remote_tool.py +0 -0
  24. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/__init__.py +0 -0
  25. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/constants.py +0 -0
  26. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/format.py +0 -0
  27. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/indexes/__init__.py +0 -0
  28. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/indexes/base_index.py +0 -0
  29. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/indexes/index.py +0 -0
  30. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/indexes/local_index.py +0 -0
  31. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/indexes/remote_index.py +0 -0
  32. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/parse.py +0 -0
  33. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/stores/utils.py +0 -0
  34. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/README.md +0 -0
  35. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index/hello/__init__.py +0 -0
  36. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index/tools.py +0 -0
  37. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index/tools.toml +0 -0
  38. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_custom_class/foo.py +0 -0
  39. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_custom_class/tools.toml +0 -0
  40. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_function_error/foo.py +0 -0
  41. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_function_error/tools.toml +0 -0
  42. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_w_deps/mock_index/__init__.py +0 -0
  43. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_w_deps/pyproject.toml +0 -0
  44. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_w_deps/requirements.txt +0 -0
  45. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/mock_index_w_deps/tools.toml +0 -0
  46. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_format/conftest.py +0 -0
  47. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_format/test_format.py +0 -0
  48. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_indexes/conftest.py +0 -0
  49. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_indexes/test_base_index.py +0 -0
  50. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_indexes/test_index.py +0 -0
  51. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_indexes/test_local_index.py +0 -0
  52. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_indexes/test_remote_index.py +0 -0
  53. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_indexes/test_venv_utils.py +0 -0
  54. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_parse/conftest.py +0 -0
  55. {stores-0.1.7.dev4 → stores-0.1.7.dev6}/tests/test_parse/test_parse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stores
3
- Version: 0.1.7.dev4
3
+ Version: 0.1.7.dev6
4
4
  Summary: Repository of Python functions and tools for LLMs
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.10
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stores"
3
- version = "0.1.7dev4"
3
+ version = "0.1.7dev6"
4
4
  description = "Repository of Python functions and tools for LLMs"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -1,5 +1,3 @@
1
- import asyncio
2
-
3
1
  import stores # noqa
4
2
 
5
3
  index = stores.indexes.LocalIndex(
@@ -27,4 +25,10 @@ async def collect():
27
25
  # print(value)
28
26
 
29
27
 
30
- asyncio.run(collect())
28
+ # asyncio.run(collect())
29
+
30
+ for value in index.stream_execute(
31
+ "basic_browser_use.stream_browser_agent",
32
+ {"task": "What are the latest OpenAI models?"},
33
+ ):
34
+ print(value)
@@ -0,0 +1,24 @@
1
+ import stores # noqa
2
+
3
+ index = stores.Index(
4
+ ["silanthro/python-sandbox"],
5
+ # env_var={
6
+ # "silanthro/python-sandbox": {
7
+ # "DENO_PATH": "/drive3/Silanthro/tools/python-sandbox/deno"
8
+ # }
9
+ # },
10
+ )
11
+ print(index.tools)
12
+
13
+ # for value in index.stream_execute("sandbox.run_code", {"code": "1+1"}):
14
+ # print(value)
15
+
16
+ print(
17
+ index.execute(
18
+ "sandbox.run_code",
19
+ kwargs={
20
+ "timeout": 5,
21
+ "code": "def is_prime(n):\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n\nprimes = []\nnum = 2\nwhile len(primes) < 10:\n if is_prime(num):\n primes.append(num)\n num += 1\n\nsum(primes)",
22
+ },
23
+ )
24
+ )
@@ -5,6 +5,7 @@ import json
5
5
  import logging
6
6
  import os
7
7
  import pickle
8
+ import queue
8
9
  import socket
9
10
  import subprocess
10
11
  import sys
@@ -340,16 +341,43 @@ def parse_tool_signature(
340
341
  elif signature_dict.get("isgeneratorfunction"):
341
342
 
342
343
  def func_handler(*args, **kwargs):
343
- for value in run_remote_tool(
344
- tool_id=signature_dict["tool_id"],
345
- index_folder=index_folder,
346
- args=args,
347
- kwargs=kwargs,
348
- venv=venv,
349
- env_var=env_var,
350
- stream=True,
351
- ):
352
- yield value
344
+ q = queue.Queue()
345
+ sentinel = object()
346
+
347
+ def run():
348
+ async def runner():
349
+ try:
350
+ async for item in run_remote_tool(
351
+ tool_id=signature_dict["tool_id"],
352
+ index_folder=index_folder,
353
+ args=args,
354
+ kwargs=kwargs,
355
+ venv=venv,
356
+ env_var=env_var,
357
+ stream=True,
358
+ ):
359
+ q.put(item)
360
+ except Exception as e:
361
+ q.put(e)
362
+ finally:
363
+ q.put(sentinel)
364
+
365
+ asyncio.run(runner())
366
+
367
+ t = threading.Thread(target=run)
368
+ t.start()
369
+
370
+ while True:
371
+ item = q.get()
372
+ if item is sentinel:
373
+ break
374
+ elif isinstance(item, Exception):
375
+ raise item
376
+ else:
377
+ yield item
378
+
379
+ t.join()
380
+
353
381
  elif signature_dict.get("iscoroutinefunction"):
354
382
 
355
383
  async def func_handler(*args, **kwargs):
@@ -2963,7 +2963,7 @@ wheels = [
2963
2963
 
2964
2964
  [[package]]
2965
2965
  name = "stores"
2966
- version = "0.1.7.dev3"
2966
+ version = "0.1.7.dev5"
2967
2967
  source = { editable = "." }
2968
2968
  dependencies = [
2969
2969
  { name = "dirtyjson" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes