API

Julep Python SDK Index / Julep / Api / Client

Auto-generated documentation for julep.api.client module.

Attributes

AsyncJulepApi

Show source in client.py:1834

Signature

class AsyncJulepApi:
    def __init__(
        self,
        base_url: typing.Optional[str] = None,
        environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT,
        api_key: str,
        timeout: typing.Optional[float] = 300,
        httpx_client: typing.Optional[httpx.AsyncClient] = None,
    ): ...

AsyncJulepApi().chat

Show source in client.py:2471

Arguments

  • - session_id - str.

  • - messages - typing.List[InputChatMlMessage]. A list of new input messages comprising the conversation so far.

  • - tools - typing.Optional[typing.List[Tool]]. (Advanced) List of tools that are provided in addition to agent's default set of tools. Functions of same name in agent set are overriden

  • - tool_choice - typing.Optional[ChatInputDataToolChoice]. Can be one of existing tools given to the agent earlier or the ones included in the request

  • - frequency_penalty - typing.Optional[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

  • - length_penalty - typing.Optional[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.

  • - logit_bias - typing.Optional[typing.Dict[str, typing.Optional[int]]]. Modify the likelihood of specified tokens appearing in the completion.

                                                                     Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
  • - max_tokens - typing.Optional[int]. The maximum number of tokens to generate in the chat completion.

                                  The total length of input tokens and generated tokens is limited by the model's context length.
  • - presence_penalty - typing.Optional[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

  • - repetition_penalty - typing.Optional[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

  • - response_format - typing.Optional[ChatSettingsResponseFormat]. An object specifying the format that the model must output.

Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.

                                                            **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.
  • - seed - typing.Optional[int]. This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.

  • - stop - typing.Optional[ChatSettingsStop]. Up to 4 sequences where the API will stop generating further tokens.

  • - stream - typing.Optional[bool]. If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Example Python code.

  • - temperature - typing.Optional[float]. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

  • - top_p - typing.Optional[float]. Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.

  • - min_p - typing.Optional[float]. Minimum probability compared to leading token to be considered

  • - preset - typing.Optional[ChatSettingsPreset]. Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual)

  • - recall - typing.Optional[bool]. Whether previous memories should be recalled or not

  • - record - typing.Optional[bool]. Whether this interaction should be recorded in history or not

    • - remember - typing.Optional[bool]. Whether this interaction should form memories or not


from julep import InputChatMlMessage, InputChatMlMessageRole from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.chat( session_id="session_id", min_p=0.01, messages=[ InputChatMlMessage( role=InputChatMlMessageRole.USER, content="content", ) ], )

Signature

async def chat(
    self,
    session_id: str,
    messages: typing.List[InputChatMlMessage],
    tools: typing.Optional[typing.List[Tool]] = OMIT,
    tool_choice: typing.Optional[ChatInputDataToolChoice] = OMIT,
    frequency_penalty: typing.Optional[float] = OMIT,
    length_penalty: typing.Optional[float] = OMIT,
    logit_bias: typing.Optional[typing.Dict[str, typing.Optional[int]]] = OMIT,
    max_tokens: typing.Optional[int] = OMIT,
    presence_penalty: typing.Optional[float] = OMIT,
    repetition_penalty: typing.Optional[float] = OMIT,
    response_format: typing.Optional[ChatSettingsResponseFormat] = OMIT,
    seed: typing.Optional[int] = OMIT,
    stop: typing.Optional[ChatSettingsStop] = OMIT,
    stream: typing.Optional[bool] = OMIT,
    temperature: typing.Optional[float] = OMIT,
    top_p: typing.Optional[float] = OMIT,
    min_p: typing.Optional[float] = OMIT,
    preset: typing.Optional[ChatSettingsPreset] = OMIT,
    recall: typing.Optional[bool] = OMIT,
    record: typing.Optional[bool] = OMIT,
    remember: typing.Optional[bool] = OMIT,
) -> ChatResponse: ...

See also

AsyncJulepApi().create_agent

Show source in client.py:2120

Create a new agent

Arguments

  • - name - str. Name of the agent

  • - about - typing.Optional[str]. About the agent

  • - tools - typing.Optional[typing.List[CreateToolRequest]]. A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.

  • - default_settings - typing.Optional[AgentDefaultSettings]. Default model settings to start every session with

  • - model - typing.Optional[str]. Name of the model that the agent is supposed to use

  • - docs - typing.Optional[typing.List[CreateDoc]]. List of docs about agent

  • - metadata - typing.Optional[CreateAgentRequestMetadata]. (Optional) metadata

    • - instructions - typing.Optional[CreateAgentRequestInstructions]. Instructions for the agent


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.create_agent( name="name", )

Signature

async def create_agent(
    self,
    name: str,
    about: typing.Optional[str] = OMIT,
    tools: typing.Optional[typing.List[CreateToolRequest]] = OMIT,
    default_settings: typing.Optional[AgentDefaultSettings] = OMIT,
    model: typing.Optional[str] = OMIT,
    docs: typing.Optional[typing.List[CreateDoc]] = OMIT,
    metadata: typing.Optional[CreateAgentRequestMetadata] = OMIT,
    instructions: typing.Optional[CreateAgentRequestInstructions] = OMIT,
) -> ResourceCreatedResponse: ...

See also

AsyncJulepApi().create_agent_doc

Show source in client.py:3101

Arguments

  • - agent_id - str.

    • - request - CreateDoc.


from julep import CreateDoc from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.create_agent_doc( agent_id="agent_id", request=CreateDoc( title="title", ), )

Signature

async def create_agent_doc(
    self, agent_id: str, request: CreateDoc
) -> ResourceCreatedResponse: ...

AsyncJulepApi().create_agent_tool

Show source in client.py:3394

Arguments

  • - agent_id - str.

    • - request - CreateToolRequest.


from julep import CreateToolRequest, CreateToolRequestType, FunctionDef from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.create_agent_tool( agent_id="agent_id", request=CreateToolRequest( type=CreateToolRequestType.FUNCTION, function=FunctionDef( name="name", parameters={}, ), ), )

Signature

async def create_agent_tool(
    self, agent_id: str, request: CreateToolRequest
) -> ResourceCreatedResponse: ...

AsyncJulepApi().create_session

Show source in client.py:1907

Create a session between an agent and a user

Arguments

  • - user_id - typing.Optional[str]. (Optional) User ID of user to associate with this session

  • - agent_id - str. Agent ID of agent to associate with this session

  • - situation - typing.Optional[str]. A specific situation that sets the background for this session

  • - metadata - typing.Optional[CreateSessionRequestMetadata]. Optional metadata

    • - render_templates - typing.Optional[bool]. Render system and assistant message content as jinja templates


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.create_session( agent_id="agent_id", )

Signature

async def create_session(
    self,
    user_id: typing.Optional[str] = OMIT,
    agent_id: str,
    situation: typing.Optional[str] = OMIT,
    metadata: typing.Optional[CreateSessionRequestMetadata] = OMIT,
    render_templates: typing.Optional[bool] = OMIT,
) -> ResourceCreatedResponse: ...

See also

AsyncJulepApi().create_user

Show source in client.py:2016

Create a new user

Arguments

  • - name - typing.Optional[str]. Name of the user

  • - about - typing.Optional[str]. About the user

  • - docs - typing.Optional[typing.List[CreateDoc]]. List of docs about user

    • - metadata - typing.Optional[CreateUserRequestMetadata]. (Optional) metadata


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.create_user()

Signature

async def create_user(
    self,
    name: typing.Optional[str] = OMIT,
    about: typing.Optional[str] = OMIT,
    docs: typing.Optional[typing.List[CreateDoc]] = OMIT,
    metadata: typing.Optional[CreateUserRequestMetadata] = OMIT,
) -> ResourceCreatedResponse: ...

See also

AsyncJulepApi().create_user_doc

Show source in client.py:3202

Arguments

  • - user_id - str.

    • - request - CreateDoc.


from julep import CreateDoc from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.create_user_doc( user_id="user_id", request=CreateDoc( title="title", ), )

Signature

async def create_user_doc(
    self, user_id: str, request: CreateDoc
) -> ResourceCreatedResponse: ...

AsyncJulepApi().delete_agent

Show source in client.py:2941

Arguments

- `-` *agent_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_agent( agent_id="agent_id", )

Signature

async def delete_agent(self, agent_id: str) -> None: ...

AsyncJulepApi().delete_agent_doc

Show source in client.py:3279

Arguments

  • - agent_id - str.

    • - doc_id - str.


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_agent_doc( agent_id="agent_id", doc_id="doc_id", )

Signature

async def delete_agent_doc(self, agent_id: str, doc_id: str) -> None: ...

AsyncJulepApi().delete_agent_memory

Show source in client.py:3315

Arguments

  • - agent_id - str.

    • - memory_id - str.


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_agent_memory( agent_id="agent_id", memory_id="memory_id", )

Signature

async def delete_agent_memory(self, agent_id: str, memory_id: str) -> None: ...

AsyncJulepApi().delete_agent_tool

Show source in client.py:3485

Arguments

  • - agent_id - str.

    • - tool_id - str.


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_agent_tool( agent_id="agent_id", tool_id="tool_id", )

Signature

async def delete_agent_tool(self, agent_id: str, tool_id: str) -> None: ...

AsyncJulepApi().delete_session

Show source in client.py:2270

Arguments

- `-` *session_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_session( session_id="session_id", )

Signature

async def delete_session(self, session_id: str) -> None: ...

AsyncJulepApi().delete_session_history

Show source in client.py:2438

Arguments

- `-` *session_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_session_history( session_id="session_id", )

Signature

async def delete_session_history(self, session_id: str) -> None: ...

AsyncJulepApi().delete_user

Show source in client.py:2758

Arguments

- `-` *user_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_user( user_id="user_id", )

Signature

async def delete_user(self, user_id: str) -> None: ...

AsyncJulepApi().delete_user_doc

Show source in client.py:3243

Arguments

  • - user_id - str.

    • - doc_id - str.


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.delete_user_doc( user_id="user_id", doc_id="doc_id", )

Signature

async def delete_user_doc(self, user_id: str, doc_id: str) -> None: ...

AsyncJulepApi().get_agent

Show source in client.py:2843

Arguments

- `-` *agent_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_agent( agent_id="agent_id", )

Signature

async def get_agent(self, agent_id: str) -> Agent: ...

AsyncJulepApi().get_agent_docs

Show source in client.py:3041

Sorted (created_at descending)

Arguments

  • - agent_id - str.

  • - limit - typing.Optional[int].

  • - offset - typing.Optional[int].

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[GetAgentDocsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[GetAgentDocsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_agent_docs( agent_id="agent_id", )

Signature

async def get_agent_docs(
    self,
    agent_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[GetAgentDocsRequestSortBy] = None,
    order: typing.Optional[GetAgentDocsRequestOrder] = None,
) -> GetAgentDocsResponse: ...

AsyncJulepApi().get_agent_memories

Show source in client.py:2623

Sorted (created_at descending)

Arguments

  • - agent_id - str.

  • - query - str.

  • - user_id - typing.Optional[str].

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_agent_memories( agent_id="agent_id", query="query", )

Signature

async def get_agent_memories(
    self,
    agent_id: str,
    query: str,
    user_id: typing.Optional[str] = None,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetAgentMemoriesResponse: ...

AsyncJulepApi().get_agent_tools

Show source in client.py:3351

Sorted (created_at descending)

Arguments

  • - agent_id - str.

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_agent_tools( agent_id="agent_id", )

Signature

async def get_agent_tools(
    self,
    agent_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetAgentToolsResponse: ...

AsyncJulepApi().get_history

Show source in client.py:2394

Sorted (created_at ascending)

Arguments

  • - session_id - str.

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_history( session_id="session_id", )

Signature

async def get_history(
    self,
    session_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetHistoryResponse: ...

AsyncJulepApi().get_job_status

Show source in client.py:3564

Arguments

- `-` *job_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_job_status( job_id="job_id", )

Signature

async def get_job_status(self, job_id: str) -> JobStatus: ...

AsyncJulepApi().get_session

Show source in client.py:2191

Arguments

- `-` *session_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_session( session_id="session_id", )

Signature

async def get_session(self, session_id: str) -> Session: ...

AsyncJulepApi().get_suggestions

Show source in client.py:2350

Sorted (created_at descending)

Arguments

  • - session_id - str.

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_suggestions( session_id="session_id", )

Signature

async def get_suggestions(
    self,
    session_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetSuggestionsResponse: ...

AsyncJulepApi().get_user

Show source in client.py:2675

Arguments

- `-` *user_id* - str.

from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_user( user_id="user_id", )

Signature

async def get_user(self, user_id: str) -> User: ...

AsyncJulepApi().get_user_docs

Show source in client.py:3142

Sorted (created_at descending)

Arguments

  • - user_id - str.

  • - limit - typing.Optional[int].

  • - offset - typing.Optional[int].

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[GetUserDocsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[GetUserDocsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.get_user_docs( user_id="user_id", )

Signature

async def get_user_docs(
    self,
    user_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[GetUserDocsRequestSortBy] = None,
    order: typing.Optional[GetUserDocsRequestOrder] = None,
) -> GetUserDocsResponse: ...

AsyncJulepApi().list_agents

Show source in client.py:2067

List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of created_at by default)

Arguments

  • - limit - typing.Optional[int]. Number of items to return

  • - offset - typing.Optional[int]. Number of items to skip (sorted created_at descending order)

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[ListAgentsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[ListAgentsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.list_agents()

Signature

async def list_agents(
    self,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[ListAgentsRequestSortBy] = None,
    order: typing.Optional[ListAgentsRequestOrder] = None,
) -> ListAgentsResponse: ...

AsyncJulepApi().list_sessions

Show source in client.py:1854

List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of created_at by default)

Arguments

  • - limit - typing.Optional[int]. Number of sessions to return

  • - offset - typing.Optional[int]. Number of sessions to skip (sorted created_at descending order)

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[ListSessionsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[ListSessionsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.list_sessions()

Signature

async def list_sessions(
    self,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[ListSessionsRequestSortBy] = None,
    order: typing.Optional[ListSessionsRequestOrder] = None,
) -> ListSessionsResponse: ...

AsyncJulepApi().list_users

Show source in client.py:1963

List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of created_at by default)

Arguments

  • - limit - typing.Optional[int]. Number of items to return

  • - offset - typing.Optional[int]. Number of items to skip (sorted created_at descending order)

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[ListUsersRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[ListUsersRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.list_users()

Signature

async def list_users(
    self,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[ListUsersRequestSortBy] = None,
    order: typing.Optional[ListUsersRequestOrder] = None,
) -> ListUsersResponse: ...

AsyncJulepApi().patch_agent

Show source in client.py:2973

Arguments

  • - agent_id - str.

  • - about - typing.Optional[str]. About the agent

  • - name - typing.Optional[str]. Name of the agent

  • - model - typing.Optional[str]. Name of the model that the agent is supposed to use

  • - default_settings - typing.Optional[AgentDefaultSettings]. Default model settings to start every session with

  • - metadata - typing.Optional[PatchAgentRequestMetadata]. Optional metadata

    • - instructions - typing.Optional[PatchAgentRequestInstructions]. Instructions for the agent


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.patch_agent( agent_id="agent_id", )

Signature

async def patch_agent(
    self,
    agent_id: str,
    about: typing.Optional[str] = OMIT,
    name: typing.Optional[str] = OMIT,
    model: typing.Optional[str] = OMIT,
    default_settings: typing.Optional[AgentDefaultSettings] = OMIT,
    metadata: typing.Optional[PatchAgentRequestMetadata] = OMIT,
    instructions: typing.Optional[PatchAgentRequestInstructions] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

AsyncJulepApi().patch_agent_tool

Show source in client.py:3521

Arguments

  • - agent_id - str.

  • - tool_id - str.

    • - function - PartialFunctionDef. Function definition and parameters


from julep import PartialFunctionDef from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.patch_agent_tool( agent_id="agent_id", tool_id="tool_id", function=PartialFunctionDef(), )

Signature

async def patch_agent_tool(
    self, agent_id: str, tool_id: str, function: PartialFunctionDef
) -> ResourceUpdatedResponse: ...

AsyncJulepApi().patch_session

Show source in client.py:2302

Arguments

  • - session_id - str.

  • - situation - typing.Optional[str]. Updated situation for this session

    • - metadata - typing.Optional[PatchSessionRequestMetadata]. Optional metadata


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.patch_session( session_id="session_id", )

Signature

async def patch_session(
    self,
    session_id: str,
    situation: typing.Optional[str] = OMIT,
    metadata: typing.Optional[PatchSessionRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

AsyncJulepApi().patch_user

Show source in client.py:2790

Arguments

  • - user_id - str.

  • - about - typing.Optional[str]. About the user

  • - name - typing.Optional[str]. Name of the user

    • - metadata - typing.Optional[PatchUserRequestMetadata]. Optional metadata


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.patch_user( user_id="user_id", )

Signature

async def patch_user(
    self,
    user_id: str,
    about: typing.Optional[str] = OMIT,
    name: typing.Optional[str] = OMIT,
    metadata: typing.Optional[PatchUserRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

AsyncJulepApi().update_agent

Show source in client.py:2875

Arguments

  • - agent_id - str.

  • - about - str. About the agent

  • - name - str. Name of the agent

  • - model - typing.Optional[str]. Name of the model that the agent is supposed to use

  • - default_settings - typing.Optional[AgentDefaultSettings]. Default model settings to start every session with

  • - metadata - typing.Optional[UpdateAgentRequestMetadata]. Optional metadata

    • - instructions - typing.Optional[UpdateAgentRequestInstructions]. Instructions for the agent


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.update_agent( agent_id="agent_id", about="about", name="name", )

Signature

async def update_agent(
    self,
    agent_id: str,
    about: str,
    name: str,
    model: typing.Optional[str] = OMIT,
    default_settings: typing.Optional[AgentDefaultSettings] = OMIT,
    metadata: typing.Optional[UpdateAgentRequestMetadata] = OMIT,
    instructions: typing.Optional[UpdateAgentRequestInstructions] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

AsyncJulepApi().update_agent_tool

Show source in client.py:3439

Arguments

  • - agent_id - str.

  • - tool_id - str.

    • - function - FunctionDef. Function definition and parameters


from julep import FunctionDef from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.update_agent_tool( agent_id="agent_id", tool_id="tool_id", function=FunctionDef( name="name", parameters={}, ), )

Signature

async def update_agent_tool(
    self, agent_id: str, tool_id: str, function: FunctionDef
) -> ResourceUpdatedResponse: ...

AsyncJulepApi().update_session

Show source in client.py:2223

Arguments

  • - session_id - str.

  • - situation - str. Updated situation for this session

    • - metadata - typing.Optional[UpdateSessionRequestMetadata]. Optional metadata


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.update_session( session_id="session_id", situation="situation", )

Signature

async def update_session(
    self,
    session_id: str,
    situation: str,
    metadata: typing.Optional[UpdateSessionRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

AsyncJulepApi().update_user

Show source in client.py:2707

Arguments

  • - user_id - str.

  • - about - str. About the user

  • - name - str. Name of the user

    • - metadata - typing.Optional[UpdateUserRequestMetadata]. Optional metadata


from julep.client import AsyncJulepApi

client = AsyncJulepApi( api_key="YOUR_API_KEY", ) await client.update_user( user_id="user_id", about="about", name="name", )

Signature

async def update_user(
    self,
    user_id: str,
    about: str,
    name: str,
    metadata: typing.Optional[UpdateUserRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

JulepApi

Show source in client.py:73

Signature

class JulepApi:
    def __init__(
        self,
        base_url: typing.Optional[str] = None,
        environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT,
        api_key: str,
        timeout: typing.Optional[float] = 300,
        httpx_client: typing.Optional[httpx.Client] = None,
    ): ...

JulepApi().chat

Show source in client.py:708

Arguments

  • - session_id - str.

  • - messages - typing.List[InputChatMlMessage]. A list of new input messages comprising the conversation so far.

  • - tools - typing.Optional[typing.List[Tool]]. (Advanced) List of tools that are provided in addition to agent's default set of tools. Functions of same name in agent set are overriden

  • - tool_choice - typing.Optional[ChatInputDataToolChoice]. Can be one of existing tools given to the agent earlier or the ones included in the request

  • - frequency_penalty - typing.Optional[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

  • - length_penalty - typing.Optional[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.

  • - logit_bias - typing.Optional[typing.Dict[str, typing.Optional[int]]]. Modify the likelihood of specified tokens appearing in the completion.

                                                                     Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
  • - max_tokens - typing.Optional[int]. The maximum number of tokens to generate in the chat completion.

                                  The total length of input tokens and generated tokens is limited by the model's context length.
  • - presence_penalty - typing.Optional[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

  • - repetition_penalty - typing.Optional[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

  • - response_format - typing.Optional[ChatSettingsResponseFormat]. An object specifying the format that the model must output.

Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.

                                                            **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.
  • - seed - typing.Optional[int]. This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.

  • - stop - typing.Optional[ChatSettingsStop]. Up to 4 sequences where the API will stop generating further tokens.

  • - stream - typing.Optional[bool]. If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Example Python code.

  • - temperature - typing.Optional[float]. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

  • - top_p - typing.Optional[float]. Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.

  • - min_p - typing.Optional[float]. Minimum probability compared to leading token to be considered

  • - preset - typing.Optional[ChatSettingsPreset]. Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual)

  • - recall - typing.Optional[bool]. Whether previous memories should be recalled or not

  • - record - typing.Optional[bool]. Whether this interaction should be recorded in history or not

    • - remember - typing.Optional[bool]. Whether this interaction should form memories or not


from julep import InputChatMlMessage, InputChatMlMessageRole from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.chat( session_id="session_id", min_p=0.01, messages=[ InputChatMlMessage( role=InputChatMlMessageRole.USER, content="content", ) ], )

Signature

def chat(
    self,
    session_id: str,
    messages: typing.List[InputChatMlMessage],
    tools: typing.Optional[typing.List[Tool]] = OMIT,
    tool_choice: typing.Optional[ChatInputDataToolChoice] = OMIT,
    frequency_penalty: typing.Optional[float] = OMIT,
    length_penalty: typing.Optional[float] = OMIT,
    logit_bias: typing.Optional[typing.Dict[str, typing.Optional[int]]] = OMIT,
    max_tokens: typing.Optional[int] = OMIT,
    presence_penalty: typing.Optional[float] = OMIT,
    repetition_penalty: typing.Optional[float] = OMIT,
    response_format: typing.Optional[ChatSettingsResponseFormat] = OMIT,
    seed: typing.Optional[int] = OMIT,
    stop: typing.Optional[ChatSettingsStop] = OMIT,
    stream: typing.Optional[bool] = OMIT,
    temperature: typing.Optional[float] = OMIT,
    top_p: typing.Optional[float] = OMIT,
    min_p: typing.Optional[float] = OMIT,
    preset: typing.Optional[ChatSettingsPreset] = OMIT,
    recall: typing.Optional[bool] = OMIT,
    record: typing.Optional[bool] = OMIT,
    remember: typing.Optional[bool] = OMIT,
) -> ChatResponse: ...

See also

JulepApi().create_agent

Show source in client.py:357

Create a new agent

Arguments

  • - name - str. Name of the agent

  • - about - typing.Optional[str]. About the agent

  • - tools - typing.Optional[typing.List[CreateToolRequest]]. A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.

  • - default_settings - typing.Optional[AgentDefaultSettings]. Default model settings to start every session with

  • - model - typing.Optional[str]. Name of the model that the agent is supposed to use

  • - docs - typing.Optional[typing.List[CreateDoc]]. List of docs about agent

  • - metadata - typing.Optional[CreateAgentRequestMetadata]. (Optional) metadata

    • - instructions - typing.Optional[CreateAgentRequestInstructions]. Instructions for the agent


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.create_agent( name="name", )

Signature

def create_agent(
    self,
    name: str,
    about: typing.Optional[str] = OMIT,
    tools: typing.Optional[typing.List[CreateToolRequest]] = OMIT,
    default_settings: typing.Optional[AgentDefaultSettings] = OMIT,
    model: typing.Optional[str] = OMIT,
    docs: typing.Optional[typing.List[CreateDoc]] = OMIT,
    metadata: typing.Optional[CreateAgentRequestMetadata] = OMIT,
    instructions: typing.Optional[CreateAgentRequestInstructions] = OMIT,
) -> ResourceCreatedResponse: ...

See also

JulepApi().create_agent_doc

Show source in client.py:1338

Arguments

  • - agent_id - str.

    • - request - CreateDoc.


from julep import CreateDoc from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.create_agent_doc( agent_id="agent_id", request=CreateDoc( title="title", ), )

Signature

def create_agent_doc(
    self, agent_id: str, request: CreateDoc
) -> ResourceCreatedResponse: ...

JulepApi().create_agent_tool

Show source in client.py:1631

Arguments

  • - agent_id - str.

    • - request - CreateToolRequest.


from julep import CreateToolRequest, CreateToolRequestType, FunctionDef from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.create_agent_tool( agent_id="agent_id", request=CreateToolRequest( type=CreateToolRequestType.FUNCTION, function=FunctionDef( name="name", parameters={}, ), ), )

Signature

def create_agent_tool(
    self, agent_id: str, request: CreateToolRequest
) -> ResourceCreatedResponse: ...

JulepApi().create_session

Show source in client.py:144

Create a session between an agent and a user

Arguments

  • - user_id - typing.Optional[str]. (Optional) User ID of user to associate with this session

  • - agent_id - str. Agent ID of agent to associate with this session

  • - situation - typing.Optional[str]. A specific situation that sets the background for this session

  • - metadata - typing.Optional[CreateSessionRequestMetadata]. Optional metadata

    • - render_templates - typing.Optional[bool]. Render system and assistant message content as jinja templates


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.create_session( agent_id="agent_id", )

Signature

def create_session(
    self,
    user_id: typing.Optional[str] = OMIT,
    agent_id: str,
    situation: typing.Optional[str] = OMIT,
    metadata: typing.Optional[CreateSessionRequestMetadata] = OMIT,
    render_templates: typing.Optional[bool] = OMIT,
) -> ResourceCreatedResponse: ...

See also

JulepApi().create_user

Show source in client.py:253

Create a new user

Arguments

  • - name - typing.Optional[str]. Name of the user

  • - about - typing.Optional[str]. About the user

  • - docs - typing.Optional[typing.List[CreateDoc]]. List of docs about user

    • - metadata - typing.Optional[CreateUserRequestMetadata]. (Optional) metadata


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.create_user()

Signature

def create_user(
    self,
    name: typing.Optional[str] = OMIT,
    about: typing.Optional[str] = OMIT,
    docs: typing.Optional[typing.List[CreateDoc]] = OMIT,
    metadata: typing.Optional[CreateUserRequestMetadata] = OMIT,
) -> ResourceCreatedResponse: ...

See also

JulepApi().create_user_doc

Show source in client.py:1439

Arguments

  • - user_id - str.

    • - request - CreateDoc.


from julep import CreateDoc from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.create_user_doc( user_id="user_id", request=CreateDoc( title="title", ), )

Signature

def create_user_doc(
    self, user_id: str, request: CreateDoc
) -> ResourceCreatedResponse: ...

JulepApi().delete_agent

Show source in client.py:1178

Arguments

- `-` *agent_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_agent( agent_id="agent_id", )

Signature

def delete_agent(self, agent_id: str) -> None: ...

JulepApi().delete_agent_doc

Show source in client.py:1516

Arguments

  • - agent_id - str.

    • - doc_id - str.


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_agent_doc( agent_id="agent_id", doc_id="doc_id", )

Signature

def delete_agent_doc(self, agent_id: str, doc_id: str) -> None: ...

JulepApi().delete_agent_memory

Show source in client.py:1552

Arguments

  • - agent_id - str.

    • - memory_id - str.


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_agent_memory( agent_id="agent_id", memory_id="memory_id", )

Signature

def delete_agent_memory(self, agent_id: str, memory_id: str) -> None: ...

JulepApi().delete_agent_tool

Show source in client.py:1722

Arguments

  • - agent_id - str.

    • - tool_id - str.


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_agent_tool( agent_id="agent_id", tool_id="tool_id", )

Signature

def delete_agent_tool(self, agent_id: str, tool_id: str) -> None: ...

JulepApi().delete_session

Show source in client.py:507

Arguments

- `-` *session_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_session( session_id="session_id", )

Signature

def delete_session(self, session_id: str) -> None: ...

JulepApi().delete_session_history

Show source in client.py:675

Arguments

- `-` *session_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_session_history( session_id="session_id", )

Signature

def delete_session_history(self, session_id: str) -> None: ...

JulepApi().delete_user

Show source in client.py:995

Arguments

- `-` *user_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_user( user_id="user_id", )

Signature

def delete_user(self, user_id: str) -> None: ...

JulepApi().delete_user_doc

Show source in client.py:1480

Arguments

  • - user_id - str.

    • - doc_id - str.


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.delete_user_doc( user_id="user_id", doc_id="doc_id", )

Signature

def delete_user_doc(self, user_id: str, doc_id: str) -> None: ...

JulepApi().get_agent

Show source in client.py:1080

Arguments

- `-` *agent_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_agent( agent_id="agent_id", )

Signature

def get_agent(self, agent_id: str) -> Agent: ...

JulepApi().get_agent_docs

Show source in client.py:1278

Sorted (created_at descending)

Arguments

  • - agent_id - str.

  • - limit - typing.Optional[int].

  • - offset - typing.Optional[int].

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[GetAgentDocsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[GetAgentDocsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_agent_docs( agent_id="agent_id", )

Signature

def get_agent_docs(
    self,
    agent_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[GetAgentDocsRequestSortBy] = None,
    order: typing.Optional[GetAgentDocsRequestOrder] = None,
) -> GetAgentDocsResponse: ...

JulepApi().get_agent_memories

Show source in client.py:860

Sorted (created_at descending)

Arguments

  • - agent_id - str.

  • - query - str.

  • - user_id - typing.Optional[str].

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_agent_memories( agent_id="agent_id", query="query", )

Signature

def get_agent_memories(
    self,
    agent_id: str,
    query: str,
    user_id: typing.Optional[str] = None,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetAgentMemoriesResponse: ...

JulepApi().get_agent_tools

Show source in client.py:1588

Sorted (created_at descending)

Arguments

  • - agent_id - str.

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_agent_tools( agent_id="agent_id", )

Signature

def get_agent_tools(
    self,
    agent_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetAgentToolsResponse: ...

JulepApi().get_history

Show source in client.py:631

Sorted (created_at ascending)

Arguments

  • - session_id - str.

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_history( session_id="session_id", )

Signature

def get_history(
    self,
    session_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetHistoryResponse: ...

JulepApi().get_job_status

Show source in client.py:1801

Arguments

- `-` *job_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_job_status( job_id="job_id", )

Signature

def get_job_status(self, job_id: str) -> JobStatus: ...

JulepApi().get_session

Show source in client.py:428

Arguments

- `-` *session_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_session( session_id="session_id", )

Signature

def get_session(self, session_id: str) -> Session: ...

JulepApi().get_suggestions

Show source in client.py:587

Sorted (created_at descending)

Arguments

  • - session_id - str.

  • - limit - typing.Optional[int].

    • - offset - typing.Optional[int].


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_suggestions( session_id="session_id", )

Signature

def get_suggestions(
    self,
    session_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
) -> GetSuggestionsResponse: ...

JulepApi().get_user

Show source in client.py:912

Arguments

- `-` *user_id* - str.

from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_user( user_id="user_id", )

Signature

def get_user(self, user_id: str) -> User: ...

JulepApi().get_user_docs

Show source in client.py:1379

Sorted (created_at descending)

Arguments

  • - user_id - str.

  • - limit - typing.Optional[int].

  • - offset - typing.Optional[int].

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[GetUserDocsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[GetUserDocsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.get_user_docs( user_id="user_id", )

Signature

def get_user_docs(
    self,
    user_id: str,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[GetUserDocsRequestSortBy] = None,
    order: typing.Optional[GetUserDocsRequestOrder] = None,
) -> GetUserDocsResponse: ...

JulepApi().list_agents

Show source in client.py:304

List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of created_at by default)

Arguments

  • - limit - typing.Optional[int]. Number of items to return

  • - offset - typing.Optional[int]. Number of items to skip (sorted created_at descending order)

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[ListAgentsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[ListAgentsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.list_agents()

Signature

def list_agents(
    self,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[ListAgentsRequestSortBy] = None,
    order: typing.Optional[ListAgentsRequestOrder] = None,
) -> ListAgentsResponse: ...

JulepApi().list_sessions

Show source in client.py:91

List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of created_at by default)

Arguments

  • - limit - typing.Optional[int]. Number of sessions to return

  • - offset - typing.Optional[int]. Number of sessions to skip (sorted created_at descending order)

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[ListSessionsRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[ListSessionsRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.list_sessions()

Signature

def list_sessions(
    self,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[ListSessionsRequestSortBy] = None,
    order: typing.Optional[ListSessionsRequestOrder] = None,
) -> ListSessionsResponse: ...

JulepApi().list_users

Show source in client.py:200

List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of created_at by default)

Arguments

  • - limit - typing.Optional[int]. Number of items to return

  • - offset - typing.Optional[int]. Number of items to skip (sorted created_at descending order)

  • - metadata_filter - typing.Optional[str]. JSON object that should be used to filter objects by metadata

  • - sort_by - typing.Optional[ListUsersRequestSortBy]. Which field to sort by: created_at or updated_at

    • - order - typing.Optional[ListUsersRequestOrder]. Which order should the sort be: asc (ascending) or desc (descending)


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.list_users()

Signature

def list_users(
    self,
    limit: typing.Optional[int] = None,
    offset: typing.Optional[int] = None,
    metadata_filter: typing.Optional[str] = None,
    sort_by: typing.Optional[ListUsersRequestSortBy] = None,
    order: typing.Optional[ListUsersRequestOrder] = None,
) -> ListUsersResponse: ...

JulepApi().patch_agent

Show source in client.py:1210

Arguments

  • - agent_id - str.

  • - about - typing.Optional[str]. About the agent

  • - name - typing.Optional[str]. Name of the agent

  • - model - typing.Optional[str]. Name of the model that the agent is supposed to use

  • - default_settings - typing.Optional[AgentDefaultSettings]. Default model settings to start every session with

  • - metadata - typing.Optional[PatchAgentRequestMetadata]. Optional metadata

    • - instructions - typing.Optional[PatchAgentRequestInstructions]. Instructions for the agent


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.patch_agent( agent_id="agent_id", )

Signature

def patch_agent(
    self,
    agent_id: str,
    about: typing.Optional[str] = OMIT,
    name: typing.Optional[str] = OMIT,
    model: typing.Optional[str] = OMIT,
    default_settings: typing.Optional[AgentDefaultSettings] = OMIT,
    metadata: typing.Optional[PatchAgentRequestMetadata] = OMIT,
    instructions: typing.Optional[PatchAgentRequestInstructions] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

JulepApi().patch_agent_tool

Show source in client.py:1758

Arguments

  • - agent_id - str.

  • - tool_id - str.

    • - function - PartialFunctionDef. Function definition and parameters


from julep import PartialFunctionDef from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.patch_agent_tool( agent_id="agent_id", tool_id="tool_id", function=PartialFunctionDef(), )

Signature

def patch_agent_tool(
    self, agent_id: str, tool_id: str, function: PartialFunctionDef
) -> ResourceUpdatedResponse: ...

JulepApi().patch_session

Show source in client.py:539

Arguments

  • - session_id - str.

  • - situation - typing.Optional[str]. Updated situation for this session

    • - metadata - typing.Optional[PatchSessionRequestMetadata]. Optional metadata


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.patch_session( session_id="session_id", )

Signature

def patch_session(
    self,
    session_id: str,
    situation: typing.Optional[str] = OMIT,
    metadata: typing.Optional[PatchSessionRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

JulepApi().patch_user

Show source in client.py:1027

Arguments

  • - user_id - str.

  • - about - typing.Optional[str]. About the user

  • - name - typing.Optional[str]. Name of the user

    • - metadata - typing.Optional[PatchUserRequestMetadata]. Optional metadata


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.patch_user( user_id="user_id", )

Signature

def patch_user(
    self,
    user_id: str,
    about: typing.Optional[str] = OMIT,
    name: typing.Optional[str] = OMIT,
    metadata: typing.Optional[PatchUserRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

JulepApi().update_agent

Show source in client.py:1112

Arguments

  • - agent_id - str.

  • - about - str. About the agent

  • - name - str. Name of the agent

  • - model - typing.Optional[str]. Name of the model that the agent is supposed to use

  • - default_settings - typing.Optional[AgentDefaultSettings]. Default model settings to start every session with

  • - metadata - typing.Optional[UpdateAgentRequestMetadata]. Optional metadata

    • - instructions - typing.Optional[UpdateAgentRequestInstructions]. Instructions for the agent


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.update_agent( agent_id="agent_id", about="about", name="name", )

Signature

def update_agent(
    self,
    agent_id: str,
    about: str,
    name: str,
    model: typing.Optional[str] = OMIT,
    default_settings: typing.Optional[AgentDefaultSettings] = OMIT,
    metadata: typing.Optional[UpdateAgentRequestMetadata] = OMIT,
    instructions: typing.Optional[UpdateAgentRequestInstructions] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

JulepApi().update_agent_tool

Show source in client.py:1676

Arguments

  • - agent_id - str.

  • - tool_id - str.

    • - function - FunctionDef. Function definition and parameters


from julep import FunctionDef from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.update_agent_tool( agent_id="agent_id", tool_id="tool_id", function=FunctionDef( name="name", parameters={}, ), )

Signature

def update_agent_tool(
    self, agent_id: str, tool_id: str, function: FunctionDef
) -> ResourceUpdatedResponse: ...

JulepApi().update_session

Show source in client.py:460

Arguments

  • - session_id - str.

  • - situation - str. Updated situation for this session

    • - metadata - typing.Optional[UpdateSessionRequestMetadata]. Optional metadata


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.update_session( session_id="session_id", situation="situation", )

Signature

def update_session(
    self,
    session_id: str,
    situation: str,
    metadata: typing.Optional[UpdateSessionRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

JulepApi().update_user

Show source in client.py:944

Arguments

  • - user_id - str.

  • - about - str. About the user

  • - name - str. Name of the user

    • - metadata - typing.Optional[UpdateUserRequestMetadata]. Optional metadata


from julep.client import JulepApi

client = JulepApi( api_key="YOUR_API_KEY", ) client.update_user( user_id="user_id", about="about", name="name", )

Signature

def update_user(
    self,
    user_id: str,
    about: str,
    name: str,
    metadata: typing.Optional[UpdateUserRequestMetadata] = OMIT,
) -> ResourceUpdatedResponse: ...

See also

Last updated