Skip to content

Commit

Permalink
chore: Update SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed May 16, 2024
1 parent 1355341 commit 96ae274
Show file tree
Hide file tree
Showing 27 changed files with 826 additions and 574 deletions.
12 changes: 6 additions & 6 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-05-09T11:41:12+00:00
# timestamp: 2024-05-16T13:06:33+00:00

from __future__ import annotations

Expand Down Expand Up @@ -585,12 +585,16 @@ class AgentDefaultSettings(BaseModel):
"""


class ContentItem(RootModel[str]):
root: Annotated[str, Field(min_length=1)]


class Doc(BaseModel):
title: str
"""
Title describing what this bit of information contains
"""
content: str
content: List[ContentItem] | str
"""
Information content
"""
Expand All @@ -608,10 +612,6 @@ class Doc(BaseModel):
"""


class ContentItem(RootModel[str]):
root: Annotated[str, Field(min_length=1)]


class CreateDoc(BaseModel):
title: str
"""
Expand Down
489 changes: 246 additions & 243 deletions agents-api/poetry.lock

Large diffs are not rendered by default.

245 changes: 182 additions & 63 deletions mock_openapi.yaml

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,14 @@ components:
type: string
description: Title describing what this bit of information contains
content:
type: string
oneOf:
- type: array
description: List of document chunks
items:
type: string
minItems: 1
- type: string
description: A single document chunk
description: Information content
id:
type: string
Expand Down
14 changes: 7 additions & 7 deletions sdks/postman/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@
}
},
"description": null,
"body": "{\n \"id\": \"id\",\n \"finish_reason\": \"stop\",\n \"response\": [\n [\n {\n \"role\": \"user\",\n \"content\": \"content\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ]\n ],\n \"usage\": {\n \"completion_tokens\": 1,\n \"prompt_tokens\": 1,\n \"total_tokens\": 1\n },\n \"jobs\": [\n \"jobs\"\n ]\n}",
"body": "{\n \"id\": \"id\",\n \"finish_reason\": \"stop\",\n \"response\": [\n [\n {\n \"role\": \"user\",\n \"content\": \"content\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ]\n ],\n \"usage\": {\n \"completion_tokens\": 1,\n \"prompt_tokens\": 1,\n \"total_tokens\": 1\n },\n \"jobs\": [\n \"jobs\"\n ],\n \"doc_ids\": {\n \"agent_doc_ids\": [\n \"agent_doc_ids\"\n ],\n \"user_doc_ids\": [\n \"user_doc_ids\"\n ]\n }\n}",
"_postman_previewlanguage": "json"
}
]
Expand Down Expand Up @@ -2256,7 +2256,7 @@
"body": null
},
"description": null,
"body": "{\n \"items\": [\n {\n \"title\": \"title\",\n \"content\": \"content\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}",
"body": "{\n \"items\": [\n {\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}",
"_postman_previewlanguage": "json"
}
]
Expand Down Expand Up @@ -2302,7 +2302,7 @@
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"title\",\n \"content\": \"content\"\n}",
"raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -2353,7 +2353,7 @@
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"title\",\n \"content\": \"content\"\n}",
"raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -2452,7 +2452,7 @@
"body": null
},
"description": null,
"body": "{\n \"items\": [\n {\n \"title\": \"title\",\n \"content\": \"content\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}",
"body": "{\n \"items\": [\n {\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}",
"_postman_previewlanguage": "json"
}
]
Expand Down Expand Up @@ -2498,7 +2498,7 @@
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"title\",\n \"content\": \"content\"\n}",
"raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -2549,7 +2549,7 @@
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"title\",\n \"content\": \"content\"\n}",
"raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}",
"options": {
"raw": {
"language": "json"
Expand Down
6 changes: 6 additions & 0 deletions sdks/python/julep/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
CreateAgentRequestInstructions,
CreateAgentRequestMetadata,
CreateDoc,
CreateDocContent,
CreateDocMetadata,
CreateSessionRequestMetadata,
CreateToolRequest,
CreateToolRequestType,
CreateUserRequestMetadata,
Doc,
DocContent,
DocIds,
DocMetadata,
FunctionCallOption,
FunctionDef,
Expand Down Expand Up @@ -106,12 +109,15 @@
"CreateAgentRequestInstructions",
"CreateAgentRequestMetadata",
"CreateDoc",
"CreateDocContent",
"CreateDocMetadata",
"CreateSessionRequestMetadata",
"CreateToolRequest",
"CreateToolRequestType",
"CreateUserRequestMetadata",
"Doc",
"DocContent",
"DocIds",
"DocMetadata",
"FunctionCallOption",
"FunctionDef",
Expand Down
4 changes: 0 additions & 4 deletions sdks/python/julep/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,6 @@ def create_agent_doc(
agent_id="agent_id",
request=CreateDoc(
title="title",
content="content",
),
)
"""
Expand Down Expand Up @@ -1458,7 +1457,6 @@ def create_user_doc(
user_id="user_id",
request=CreateDoc(
title="title",
content="content",
),
)
"""
Expand Down Expand Up @@ -3121,7 +3119,6 @@ async def create_agent_doc(
agent_id="agent_id",
request=CreateDoc(
title="title",
content="content",
),
)
"""
Expand Down Expand Up @@ -3223,7 +3220,6 @@ async def create_user_doc(
user_id="user_id",
request=CreateDoc(
title="title",
content="content",
),
)
"""
Expand Down
6 changes: 6 additions & 0 deletions sdks/python/julep/api/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@
from .create_agent_request_instructions import CreateAgentRequestInstructions
from .create_agent_request_metadata import CreateAgentRequestMetadata
from .create_doc import CreateDoc
from .create_doc_content import CreateDocContent
from .create_doc_metadata import CreateDocMetadata
from .create_session_request_metadata import CreateSessionRequestMetadata
from .create_tool_request import CreateToolRequest
from .create_tool_request_type import CreateToolRequestType
from .create_user_request_metadata import CreateUserRequestMetadata
from .doc import Doc
from .doc_content import DocContent
from .doc_ids import DocIds
from .doc_metadata import DocMetadata
from .function_call_option import FunctionCallOption
from .function_def import FunctionDef
Expand Down Expand Up @@ -103,12 +106,15 @@
"CreateAgentRequestInstructions",
"CreateAgentRequestMetadata",
"CreateDoc",
"CreateDocContent",
"CreateDocMetadata",
"CreateSessionRequestMetadata",
"CreateToolRequest",
"CreateToolRequestType",
"CreateUserRequestMetadata",
"Doc",
"DocContent",
"DocIds",
"DocMetadata",
"FunctionCallOption",
"FunctionDef",
Expand Down
2 changes: 2 additions & 0 deletions sdks/python/julep/api/types/chat_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .chat_ml_message import ChatMlMessage
from .chat_response_finish_reason import ChatResponseFinishReason
from .completion_usage import CompletionUsage
from .doc_ids import DocIds

try:
import pydantic.v1 as pydantic # type: ignore
Expand All @@ -30,6 +31,7 @@ class ChatResponse(pydantic.BaseModel):
jobs: typing.Optional[typing.List[str]] = pydantic.Field(
description="IDs (if any) of jobs created as part of this request"
)
doc_ids: DocIds

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {
Expand Down
3 changes: 2 additions & 1 deletion sdks/python/julep/api/types/create_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import typing

from ..core.datetime_utils import serialize_datetime
from .create_doc_content import CreateDocContent
from .create_doc_metadata import CreateDocMetadata

try:
Expand All @@ -16,7 +17,7 @@ class CreateDoc(pydantic.BaseModel):
title: str = pydantic.Field(
description="Title describing what this bit of information contains"
)
content: str = pydantic.Field(description="Information content")
content: CreateDocContent = pydantic.Field(description="Information content")
metadata: typing.Optional[CreateDocMetadata] = pydantic.Field(
description="Optional metadata"
)
Expand Down
5 changes: 5 additions & 0 deletions sdks/python/julep/api/types/create_doc_content.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

CreateDocContent = typing.Union[typing.List[str], str]
3 changes: 2 additions & 1 deletion sdks/python/julep/api/types/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import typing

from ..core.datetime_utils import serialize_datetime
from .doc_content import DocContent
from .doc_metadata import DocMetadata

try:
Expand All @@ -16,7 +17,7 @@ class Doc(pydantic.BaseModel):
title: str = pydantic.Field(
description="Title describing what this bit of information contains"
)
content: str = pydantic.Field(description="Information content")
content: DocContent = pydantic.Field(description="Information content")
id: str = pydantic.Field(description="ID of doc")
created_at: dt.datetime = pydantic.Field(description="Doc created at")
metadata: typing.Optional[DocMetadata] = pydantic.Field(
Expand Down
5 changes: 5 additions & 0 deletions sdks/python/julep/api/types/doc_content.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

DocContent = typing.Union[typing.List[str], str]
37 changes: 37 additions & 0 deletions sdks/python/julep/api/types/doc_ids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore


class DocIds(pydantic.BaseModel):
agent_doc_ids: typing.List[str]
user_doc_ids: typing.List[str]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {
"by_alias": True,
"exclude_unset": True,
**kwargs,
}
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {
"by_alias": True,
"exclude_unset": True,
**kwargs,
}
return super().dict(**kwargs_with_defaults)

class Config:
frozen = True
smart_union = True
json_encoders = {dt.datetime: serialize_datetime}
Loading

0 comments on commit 96ae274

Please sign in to comment.