Skip to content

Commit

Permalink
fix: Session.user_id should be optional (#298)
Browse files Browse the repository at this point in the history
* fix: Session.user_id should be optional

Signed-off-by: Diwank Singh Tomer <[email protected]>

* refactor: Lint sdks/ts (CI)

---------

Signed-off-by: Diwank Singh Tomer <[email protected]>
Co-authored-by: creatorrr <[email protected]>
  • Loading branch information
creatorrr and creatorrr authored Apr 26, 2024
1 parent 546a9f8 commit b521a9c
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 16 deletions.
4 changes: 2 additions & 2 deletions agents-api/agents_api/autogen/openapi_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: openapi.yaml
# timestamp: 2024-04-20T14:32:07+00:00
# timestamp: 2024-04-26T08:42:42+00:00

from __future__ import annotations

Expand Down Expand Up @@ -92,7 +92,7 @@ class Session(BaseModel):
"""
Session id (UUID)
"""
user_id: UUID
user_id: UUID | None = None
"""
User ID of user associated with this session
"""
Expand Down
6 changes: 3 additions & 3 deletions agents-api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mock_openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,6 @@ components:
default: false
required:
- id
- user_id
- agent_id
CreateUserRequest:
$schema: http://json-schema.org/draft-04/schema#
Expand Down
1 change: 0 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,6 @@ components:
default: false
required:
- id
- user_id
- agent_id
CreateUserRequest:
$schema: http://json-schema.org/draft-04/schema#
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/julep/api/types/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class Session(pydantic.BaseModel):
id: str = pydantic.Field(description="Session id (UUID)")
user_id: str = pydantic.Field(
user_id: typing.Optional[str] = pydantic.Field(
description="User ID of user associated with this session"
)
agent_id: str = pydantic.Field(
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "julep"
version = "0.3.0"
version = "0.3.1"
description = "Julep is a platform for creating agents with long-term memory"
authors = ["Julep Developers <[email protected]>"]
license = "ISC"
Expand Down
8 changes: 8 additions & 0 deletions sdks/python/tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ def _(client=client, session=test_session_no_user):
assert session.id


@test("sessions: sessions.get no user")
def _(client=client, session=test_session_no_user):
response = client.sessions.get(id=session.id)

assert isinstance(response, Session)
assert response.id == session.id


@test("sessions: sessions.get")
def _(client=client, session=test_session):
response = client.sessions.get(id=session.id)
Expand Down
4 changes: 2 additions & 2 deletions sdks/ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions sdks/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"name": "@julep/sdk",
"version": "0.3.0",
"version": "0.3.1",
"description": "Julep is a platform for creating agents with long-term memory",
"keywords": ["julep-ai", "julep", "agents", "llms", "memory", "ai"],
"keywords": [
"julep-ai",
"julep",
"agents",
"llms",
"memory",
"ai"
],
"author": {
"name": "Julep",
"email": "[email protected]"
Expand Down Expand Up @@ -75,5 +82,7 @@
"prepublishOnly": "npm run build",
"test": "npm run format && npm run start_mock_api && sleep 1 && jest && npm run kill_mock_api"
},
"files": ["dist"]
"files": [
"dist"
]
}
2 changes: 1 addition & 1 deletion sdks/ts/src/api/models/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Session = {
/**
* User ID of user associated with this session
*/
user_id: string;
user_id?: string;
/**
* Agent ID of agent associated with this session
*/
Expand Down
1 change: 0 additions & 1 deletion sdks/ts/src/api/schemas/$Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const $Session = {
user_id: {
type: "string",
description: `User ID of user associated with this session`,
isRequired: true,
format: "uuid",
},
agent_id: {
Expand Down

0 comments on commit b521a9c

Please sign in to comment.