not-again-ai 0.5.0__py3-none-any.whl → 0.5.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.
@@ -64,9 +64,8 @@ def chat_completion(
64
64
  this will be a list of dictionaries containing the token, logprob, and bytes for each token in the message.
65
65
  'choices' (list[dict], optional): A list of chat completion choices if n > 1 where each dict contains the above fields.
66
66
  'completion_tokens' (int): The number of tokens used by the model to generate the completion.
67
- NOTE: If n > 1 this is the sum of all completions and thus will be same value in each dict.
68
- 'prompt_tokens' (int): The number of tokens in the generated response.
69
- NOTE: If n > 1 this is the sum of all completions and thus will be same value in each dict.
67
+ NOTE: If n > 1 this is the sum of all completions.
68
+ 'prompt_tokens' (int): The number of tokens in the messages sent to the model.
70
69
  'system_fingerprint' (str, optional): If seed is set, a unique identifier for the model used to generate the response.
71
70
  """
72
71
  response_format = {"type": "json_object"} if json_mode else None
@@ -41,9 +41,8 @@ def chat_completion_vision(
41
41
  'message' (str | dict): The content of the generated assistant message.
42
42
  'choices' (list[dict], optional): A list of chat completion choices if n > 1 where each dict contains the above fields.
43
43
  'completion_tokens' (int): The number of tokens used by the model to generate the completion.
44
- NOTE: If n > 1 this is the sum of all completions and thus will be same value in each dict.
45
- 'prompt_tokens' (int): The number of tokens in the generated response.
46
- NOTE: If n > 1 this is the sum of all completions and thus will be same value in each dict.
44
+ NOTE: If n > 1 this is the sum of all completions.
45
+ 'prompt_tokens' (int): The number of tokens in the messages sent to the model.
47
46
  'system_fingerprint' (str, optional): If seed is set, a unique identifier for the model used to generate the response.
48
47
  """
49
48
  kwargs.update(
@@ -127,7 +127,7 @@ def create_image_url(image_path: Path) -> str:
127
127
 
128
128
 
129
129
  def chat_prompt_vision(messages_unformatted: list[dict[str, Any]], variables: dict[str, str]) -> list[dict[str, Any]]:
130
- """Formats a list of messages for OpenAI's chat completion API for vision models only using Liquid templating.
130
+ """Formats a list of messages for OpenAI's chat completion API, for vision models only, using Liquid templating.
131
131
 
132
132
  Args:
133
133
  messages_unformatted (list[dict[str, list[dict[str, Path | str]] | str]]):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not-again-ai
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: Designed to once and for all collect all the little things that come up over and over again in AI projects and put them in one place.
5
5
  Home-page: https://github.com/DaveCoDev/not-again-ai
6
6
  License: MIT
@@ -76,7 +76,7 @@ The package is split into subpackages, so you can install only the parts you nee
76
76
  The base package includes only functions that have minimal external dependencies and are useful in a variety of situations such as parallelization and filesystem operations.
77
77
 
78
78
  ## LLM (Large Language Model)
79
- [README](https://github.com/DaveCoDev/not-again-ai/blob/main/readmes/llm.md)
79
+ [README](https://github.com/DaveCoDev/not-again-ai/blob/main/readmes/llm.md), [Example Notebooks](https://github.com/DaveCoDev/not-again-ai/blob/main/notebooks/llm/)
80
80
 
81
81
  Supports OpenAI chat completions and text embeddings. Includes functions for creating chat completion prompts, token management, and context management.
82
82
 
@@ -3,12 +3,12 @@ not_again_ai/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
3
3
  not_again_ai/base/file_system.py,sha256=SX1ab2igdcFGjvdh4rDJIYVXbYC-jsYnCiM4oZtutAU,344
4
4
  not_again_ai/base/parallel.py,sha256=fcYhKBYBWvob84iKp3O93wvFFdXeidljZsShgBLTNGA,3448
5
5
  not_again_ai/llm/__init__.py,sha256=_wNUL6FDaT369Z8W48FsaC_NkcOZ-ib2MMUvnaLOS-0,451
6
- not_again_ai/llm/chat_completion.py,sha256=-ibM3yuM7uS_83xnvdr37azMQLHItNkARcclcCQw7Yg,8410
7
- not_again_ai/llm/chat_completion_vision.py,sha256=gdP3cjlmXjfyGUBgMO32fASFzioQ2ncnLgvCBM93YJc,4266
6
+ not_again_ai/llm/chat_completion.py,sha256=bVbFc4s-lSYfoBTX8lxyKNOWWahAmc9pl2p46jtTSzQ,8269
7
+ not_again_ai/llm/chat_completion_vision.py,sha256=3gJKNRz5kApRZ6wv49iE_yr6U_1nA4FcXTUy44IlxwY,4125
8
8
  not_again_ai/llm/context_management.py,sha256=LXNd_L-jxurIFR1bO7gWakEH8I-cZmvLW83dFtvfJa4,3424
9
9
  not_again_ai/llm/embeddings.py,sha256=4OBnxZicrY6q4dQhuPqMdAnifyjwrsKMTDj-kVre0yc,2500
10
10
  not_again_ai/llm/openai_client.py,sha256=6pZw2xw9X-ceV22rhApwFJ2tAKCxi-SxkjxBsTBZ2Nw,2470
11
- not_again_ai/llm/prompts.py,sha256=16e9b8ZKviQJOP3KVgcjRUgk1uAu64RHYZQYy5tgGnA,9496
11
+ not_again_ai/llm/prompts.py,sha256=m64oLBE1sftkyp_MDSlSHEgurd-oTbxmFpehDoyzk8M,9498
12
12
  not_again_ai/llm/tokens.py,sha256=5CQqdjsDw_CIRDKBiTNzyjq9V-MFXUURtdTqbt2Y5nU,4244
13
13
  not_again_ai/py.typed,sha256=UaCuPFa3H8UAakbt-5G8SPacldTOGvJv18pPjUJ5gDY,93
14
14
  not_again_ai/statistics/__init__.py,sha256=gA8r9JQFbFSN0ykrHy4G1IQgcky4f2eM5Oo24oVI5Ik,466
@@ -19,8 +19,8 @@ not_again_ai/viz/distributions.py,sha256=OyWwJaNI6lMRm_iSrhq-CORLNvXfeuLSgDtVo3u
19
19
  not_again_ai/viz/scatterplot.py,sha256=eBtIf0Tf_1EcN-akRNJgvwLU0zpRx1zOl0VF9QTnbZA,2290
20
20
  not_again_ai/viz/time_series.py,sha256=pOGZqXp_2nd6nKo-PUQNCtmMh__69jxQ6bQibTGLwZA,5212
21
21
  not_again_ai/viz/utils.py,sha256=hN7gwxtBt3U6jQni2K8j5m5pCXpaJDoNzGhBBikEU28,238
22
- not_again_ai-0.5.0.dist-info/LICENSE,sha256=btjOgNGpp-ux5xOo1Gx1MddxeWtT9sof3s3Nui29QfA,1071
23
- not_again_ai-0.5.0.dist-info/METADATA,sha256=XxIZQkkIXOWWUmMTycXqGTtWWUc4neLhVRGJBJsZquE,15883
24
- not_again_ai-0.5.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
25
- not_again_ai-0.5.0.dist-info/entry_points.txt,sha256=EMJegugnmJUd-jMUA_qIRMIPAasbei8gP6O4-ER0BxQ,61
26
- not_again_ai-0.5.0.dist-info/RECORD,,
22
+ not_again_ai-0.5.1.dist-info/LICENSE,sha256=btjOgNGpp-ux5xOo1Gx1MddxeWtT9sof3s3Nui29QfA,1071
23
+ not_again_ai-0.5.1.dist-info/METADATA,sha256=dbLr5FAyyBnnXc9rvZgGwUcbfyki5ayG3pZM5I9l4D8,15972
24
+ not_again_ai-0.5.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
25
+ not_again_ai-0.5.1.dist-info/entry_points.txt,sha256=EMJegugnmJUd-jMUA_qIRMIPAasbei8gP6O4-ER0BxQ,61
26
+ not_again_ai-0.5.1.dist-info/RECORD,,