solana-agent 1.3.0__py3-none-any.whl → 1.3.1__py3-none-any.whl

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.
solana_agent/ai.py CHANGED
@@ -215,8 +215,7 @@ class AI:
215
215
  else:
216
216
  uid = uuid.uuid4().hex
217
217
  self._vector_store = self._client.beta.vector_stores.create(
218
- name=uid
219
- )
218
+ name=uid)
220
219
  self._database.save_vector_store_id(self._vector_store.id)
221
220
  self._client.beta.assistants.update(
222
221
  assistant_id=self._assistant_id,
@@ -335,24 +334,14 @@ class AI:
335
334
 
336
335
  def add_file(
337
336
  self,
337
+ filename: str,
338
338
  file_stream: bytes,
339
- file_extension: Literal[
340
- "doc", "docx", "json", "md", "pdf", "pptx", "tex", "txt"
341
- ] = "pdf",
342
339
  ) -> Literal["in_progress", "completed", "cancelled", "failed"]:
343
340
  """Upload and process a file in the OpenAI vector store.
344
341
 
345
342
  Args:
343
+ filename (str): Name of the file to upload
346
344
  file_stream (bytes): Raw bytes of the file to upload
347
- file_extension (Literal, optional): File type extension. Defaults to "pdf"
348
- Supported formats:
349
- - doc, docx: Word documents
350
- - json: JSON files
351
- - md: Markdown files
352
- - pdf: PDF documents
353
- - pptx: PowerPoint presentations
354
- - tex: LaTeX files
355
- - txt: Plain text files
356
345
 
357
346
  Returns:
358
347
  Literal["in_progress", "completed", "cancelled", "failed"]: Status of file processing
@@ -360,7 +349,7 @@ class AI:
360
349
  Example:
361
350
  ```python
362
351
  with open('document.pdf', 'rb') as f:
363
- status = ai.add_file(f.read(), file_extension="pdf")
352
+ status = ai.add_file(f.filename, f.read())
364
353
  if status == "completed":
365
354
  print("File processed successfully")
366
355
  ```
@@ -374,7 +363,7 @@ class AI:
374
363
  """
375
364
  vector_store_id = self._database.get_vector_store_id()
376
365
  file = self._client.files.create(
377
- file=(f"file.{file_extension}", file_stream), purpose="assistants"
366
+ file=(filename, file_stream), purpose="assistants"
378
367
  )
379
368
  file_batch = self._client.beta.vector_stores.files.create_and_poll(
380
369
  vector_store_id=vector_store_id, file_id=file.id
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Build self-learning AI Agents
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents
@@ -0,0 +1,6 @@
1
+ solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
+ solana_agent/ai.py,sha256=RxbyG9UzvFjZSGTZ2SC7t6U0Pfw6uERaAisxGDqLsUw,41457
3
+ solana_agent-1.3.1.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
+ solana_agent-1.3.1.dist-info/METADATA,sha256=I6QyN8qmmeFzpNNlXN4ZquFJ3srdK5FuooKEOqmzTrw,4694
5
+ solana_agent-1.3.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
6
+ solana_agent-1.3.1.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- solana_agent/__init__.py,sha256=zpfnWqANd3OHGWm7NCF5Y6m01BWG4NkNk8SK9Ex48nA,18
2
- solana_agent/ai.py,sha256=o6ztao5oFuzatYIkYxGlQSf16JYgQeIaUtCwL15ojoU,41942
3
- solana_agent-1.3.0.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
4
- solana_agent-1.3.0.dist-info/METADATA,sha256=bqeaN3lk98Fd1UWZmuZaH_HiEgNo11Q0K0GmNhbTgoY,4694
5
- solana_agent-1.3.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
6
- solana_agent-1.3.0.dist-info/RECORD,,