hindsight-api 0.1.3__tar.gz → 0.1.4__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 (61) hide show
  1. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/PKG-INFO +1 -1
  2. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/llm_wrapper.py +21 -7
  3. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/pyproject.toml +1 -1
  4. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/.gitignore +0 -0
  5. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/README.md +0 -0
  6. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/__init__.py +0 -0
  7. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/README +0 -0
  8. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/env.py +0 -0
  9. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/script.py.mako +0 -0
  10. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/versions/5a366d414dce_initial_schema.py +0 -0
  11. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/versions/b7c4d8e9f1a2_add_chunks_table.py +0 -0
  12. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/versions/c8e5f2a3b4d1_add_retain_params_to_documents.py +0 -0
  13. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/versions/d9f6a3b4c5e2_rename_bank_to_interactions.py +0 -0
  14. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/versions/e0a1b2c3d4e5_disposition_to_3_traits.py +0 -0
  15. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/alembic/versions/rename_personality_to_disposition.py +0 -0
  16. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/api/__init__.py +0 -0
  17. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/api/http.py +0 -0
  18. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/api/mcp.py +0 -0
  19. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/banner.py +0 -0
  20. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/config.py +0 -0
  21. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/__init__.py +0 -0
  22. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/cross_encoder.py +0 -0
  23. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/db_utils.py +0 -0
  24. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/embeddings.py +0 -0
  25. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/entity_resolver.py +0 -0
  26. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/memory_engine.py +0 -0
  27. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/query_analyzer.py +0 -0
  28. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/response_models.py +0 -0
  29. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/__init__.py +0 -0
  30. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/bank_utils.py +0 -0
  31. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/chunk_storage.py +0 -0
  32. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/deduplication.py +0 -0
  33. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/embedding_processing.py +0 -0
  34. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/embedding_utils.py +0 -0
  35. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/entity_processing.py +0 -0
  36. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/fact_extraction.py +0 -0
  37. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/fact_storage.py +0 -0
  38. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/link_creation.py +0 -0
  39. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/link_utils.py +0 -0
  40. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/observation_regeneration.py +0 -0
  41. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/orchestrator.py +0 -0
  42. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/retain/types.py +0 -0
  43. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/__init__.py +0 -0
  44. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/fusion.py +0 -0
  45. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/observation_utils.py +0 -0
  46. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/reranking.py +0 -0
  47. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/retrieval.py +0 -0
  48. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/scoring.py +0 -0
  49. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/temporal_extraction.py +0 -0
  50. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/think_utils.py +0 -0
  51. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/trace.py +0 -0
  52. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/tracer.py +0 -0
  53. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/search/types.py +0 -0
  54. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/task_backend.py +0 -0
  55. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/engine/utils.py +0 -0
  56. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/main.py +0 -0
  57. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/metrics.py +0 -0
  58. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/migrations.py +0 -0
  59. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/models.py +0 -0
  60. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/pg0.py +0 -0
  61. {hindsight_api-0.1.3 → hindsight_api-0.1.4}/hindsight_api/server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hindsight-api
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Temporal + Semantic + Entity Memory System for AI agents using PostgreSQL
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: alembic>=1.17.1
@@ -170,24 +170,38 @@ class LLMProvider:
170
170
  "messages": messages,
171
171
  }
172
172
 
173
- if max_completion_tokens is not None:
174
- call_params["max_completion_tokens"] = max_completion_tokens
175
173
  # Check if model supports reasoning parameter (o1, o3, gpt-5 families)
176
174
  model_lower = self.model.lower()
177
175
  is_reasoning_model = any(x in model_lower for x in ["gpt-5", "o1", "o3"])
178
176
 
177
+ # For GPT-4 and GPT-4.1 models, cap max_completion_tokens to 32000
178
+ is_gpt4_model = any(x in model_lower for x in ["gpt-4.1", "gpt-4-"])
179
+ if max_completion_tokens is not None:
180
+ if is_gpt4_model and max_completion_tokens > 32000:
181
+ max_completion_tokens = 32000
182
+ # For reasoning models, max_completion_tokens includes reasoning + output tokens
183
+ # Enforce minimum of 16000 to ensure enough space for both
184
+ if is_reasoning_model and max_completion_tokens < 16000:
185
+ max_completion_tokens = 16000
186
+ call_params["max_completion_tokens"] = max_completion_tokens
187
+
179
188
  # GPT-5/o1/o3 family doesn't support custom temperature (only default 1)
180
189
  if temperature is not None and not is_reasoning_model:
181
190
  call_params["temperature"] = temperature
182
191
 
192
+ # Set reasoning_effort for reasoning models (OpenAI gpt-5, o1, o3)
193
+ if is_reasoning_model and self.provider == "openai":
194
+ call_params["reasoning_effort"] = self.reasoning_effort
195
+
183
196
  # Provider-specific parameters
184
197
  if self.provider == "groq":
185
198
  call_params["seed"] = DEFAULT_LLM_SEED
186
- call_params["extra_body"] = {
187
- "service_tier": "auto",
188
- "reasoning_effort": self.reasoning_effort,
189
- "include_reasoning": False,
190
- }
199
+ extra_body = {"service_tier": "auto"}
200
+ # Only add reasoning parameters for reasoning models
201
+ if is_reasoning_model:
202
+ extra_body["reasoning_effort"] = self.reasoning_effort
203
+ extra_body["include_reasoning"] = False
204
+ call_params["extra_body"] = extra_body
191
205
 
192
206
  last_exception = None
193
207
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hindsight-api"
7
- version = "0.1.3"
7
+ version = "0.1.4"
8
8
  description = "Temporal + Semantic + Entity Memory System for AI agents using PostgreSQL"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
File without changes
File without changes