mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-19 07:42:43 +00:00
fix: openai python sdk package export (#432)
This commit is contained in:
parent
d71ce03c46
commit
4467b65524
3 changed files with 10 additions and 27 deletions
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||
|
||||
[project]
|
||||
name = "supermemory-openai-sdk"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
description = "Memory tools for OpenAI function calling with supermemory"
|
||||
readme = "README.md"
|
||||
license = "MIT"
|
||||
|
|
@ -26,7 +26,7 @@ classifiers = [
|
|||
requires-python = ">=3.8.1"
|
||||
dependencies = [
|
||||
"openai>=1.102.0",
|
||||
"supermemory>=3.0.0a28",
|
||||
"supermemory>=3.1.0",
|
||||
"typing-extensions>=4.0.0",
|
||||
]
|
||||
|
||||
|
|
@ -46,26 +46,11 @@ Homepage = "https://supermemory.ai"
|
|||
Repository = "https://github.com/supermemoryai/supermemory"
|
||||
Documentation = "https://supermemory.ai/docs"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src"]
|
||||
[tool.hatch.build]
|
||||
include = ["src/*"]
|
||||
|
||||
[tool.black]
|
||||
line-length = 88
|
||||
target-version = ['py38']
|
||||
include = '\.pyi?$'
|
||||
extend-exclude = '''
|
||||
/(
|
||||
# directories
|
||||
\.eggs
|
||||
| \.git
|
||||
| \.hg
|
||||
| \.mypy_cache
|
||||
| \.tox
|
||||
| \.venv
|
||||
| build
|
||||
| dist
|
||||
)/
|
||||
'''
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/supermemory_openai"]
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ from .tools import (
|
|||
create_add_memory_tool,
|
||||
)
|
||||
|
||||
__version__ = "0.1.0"
|
||||
|
||||
__all__ = [
|
||||
# Tools
|
||||
"SupermemoryTools",
|
||||
|
|
@ -6,7 +6,7 @@ from typing import Dict, List, Optional, Union, TypedDict
|
|||
from openai.types.chat import (
|
||||
ChatCompletionMessageToolCall,
|
||||
ChatCompletionToolMessageParam,
|
||||
ChatCompletionToolParam,
|
||||
ChatCompletionFunctionToolParam,
|
||||
)
|
||||
import supermemory
|
||||
from supermemory.types import (
|
||||
|
|
@ -50,7 +50,7 @@ class MemoryAddResult(TypedDict, total=False):
|
|||
|
||||
|
||||
# Function schemas for OpenAI function calling
|
||||
MEMORY_TOOL_SCHEMAS = {
|
||||
MEMORY_TOOL_SCHEMAS: Dict[str, ChatCompletionFunctionToolParam] = {
|
||||
"search_memories": {
|
||||
"name": "search_memories",
|
||||
"description": (
|
||||
|
|
@ -129,7 +129,7 @@ class SupermemoryTools:
|
|||
else:
|
||||
self.container_tags = ["sm_project_default"]
|
||||
|
||||
def get_tool_definitions(self) -> List[ChatCompletionToolParam]:
|
||||
def get_tool_definitions(self) -> List[ChatCompletionFunctionToolParam]:
|
||||
"""Get OpenAI function definitions for all memory tools.
|
||||
|
||||
Returns:
|
||||
|
|
@ -247,7 +247,7 @@ def create_supermemory_tools(
|
|||
return SupermemoryTools(api_key, config)
|
||||
|
||||
|
||||
def get_memory_tool_definitions() -> List[ChatCompletionToolParam]:
|
||||
def get_memory_tool_definitions() -> List[ChatCompletionFunctionToolParam]:
|
||||
"""Get OpenAI function definitions for memory tools.
|
||||
|
||||
Returns:
|
||||
Loading…
Add table
Add a link
Reference in a new issue