Skip to content

Commit

Permalink
Add tooltip to fields
Browse files Browse the repository at this point in the history
  • Loading branch information
harishmohanraj committed Sep 16, 2024
1 parent 5413cc3 commit 24da69f
Show file tree
Hide file tree
Showing 22 changed files with 420 additions and 28 deletions.
7 changes: 6 additions & 1 deletion fastagency/studio/models/agents/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class AssistantAgent(AgentBaseModel):
system_message: Annotated[
str,
Field(
description="The system message of the agent. This message is used to inform the agent about his role in the conversation"
description="The system message of the agent. This message is used to inform the agent about his role in the conversation",
json_schema_extra={
"metadata": {
"tooltip_message": "The system message defines the agent's role and influences its responses. For example, telling the agent 'You are an expert in travel advice' will make its responses focus on travel."
}
},
),
] = "You are a helpful assistant. After you successfully answer all questions and there are no new questions asked after your response (e.g. there is no specific direction or question asked after you give a response), terminate the chat by outputting 'TERMINATE' (IMPORTANT: use all caps)"

Expand Down
20 changes: 20 additions & 0 deletions fastagency/studio/models/agents/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class AgentBaseModel(Model):
Field(
title="LLM",
description="LLM used by the agent for producing responses",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the LLM the agent will use to generate responses."
}
},
),
]

Expand All @@ -32,6 +37,11 @@ class AgentBaseModel(Model):
Field(
title="Toolbox",
description="Toolbox used by the agent for producing responses",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the toolbox that the agent will use automatically when needed to solve user queries."
}
},
),
] = None

Expand All @@ -40,6 +50,11 @@ class AgentBaseModel(Model):
Field(
title="Toolbox",
description="Toolbox used by the agent for producing responses",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the toolbox that the agent will use automatically when needed to solve user queries."
}
},
),
] = None

Expand All @@ -48,6 +63,11 @@ class AgentBaseModel(Model):
Field(
title="Toolbox",
description="Toolbox used by the agent for producing responses",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the toolbox that the agent will use automatically when needed to solve user queries."
}
},
),
] = None

Expand Down
7 changes: 6 additions & 1 deletion fastagency/studio/models/agents/user_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class UserProxyAgent(Model):
max_consecutive_auto_reply: Annotated[
Optional[int],
Field(
description="The maximum number of consecutive auto-replies the agent can make"
description="The maximum number of consecutive auto-replies the agent can make",
json_schema_extra={
"metadata": {
"tooltip_message": "Set the maximum number of consecutive auto replies the agent can make before requiring human approval. A higher value gives the agent more autonomy, while leaving it blank prompts permission for each reply. For example, if you set this to 2, the agent will reply twice and then require human approval before replying again."
}
},
),
] = None

Expand Down
38 changes: 35 additions & 3 deletions fastagency/studio/models/agents/web_surfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@

@register("secret")
class BingAPIKey(Model):
api_key: Annotated[str, Field(title="API Key", description="The API Key from Bing")]
api_key: Annotated[
str,
Field(
title="API Key",
description="The API Key from Bing",
json_schema_extra={
"metadata": {
"tooltip_message": "The API key specified here will be used to authenticate requests to Bing services."
}
},
),
]

@classmethod
async def create_autogen(cls, model_id: UUID, user_id: UUID, **kwargs: Any) -> str:
Expand Down Expand Up @@ -87,14 +98,35 @@ class WebSurferAgent(AgentBaseModel):
Field(
title="Summarizer LLM",
description="This LLM will be used to generated summary of all pages visited",
json_schema_extra={
"metadata": {
"tooltip_message": "Select the summarizer LLM, which is used for generating precise and accurate summaries of web pages, while the LLM chosen above is used for handling regular web searches."
}
},
),
]
viewport_size: Annotated[
int, Field(description="The viewport size of the browser")
int,
Field(
description="The viewport size of the browser",
json_schema_extra={
"metadata": {
"tooltip_message": "Viewport size refers to the visible area of a webpage in the browser. Default is 4096. Modify only if a custom size is needed."
}
},
),
] = 4096
bing_api_key: Annotated[
Optional[BingAPIKeyRef],
Field(title="Bing API Key", description="The Bing API key for the browser"),
Field(
title="Bing API Key",
description="The Bing API key for the browser",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose a Bing API key to allow the browser to access Bing's search and data services, improving information retrieval."
}
},
),
] = None

@classmethod
Expand Down
42 changes: 37 additions & 5 deletions fastagency/studio/models/deployments/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ class Deployment(Model):
name: Annotated[
str,
Field(
..., description="The application name to use on the website.", min_length=1
...,
description="The name of the SaaS application.",
min_length=1,
json_schema_extra={
"metadata": {
"tooltip_message": "The application name to be used in the deployed SaaS application."
}
},
),
]

Expand All @@ -39,7 +46,12 @@ class Deployment(Model):
...,
description="The name of the GitHub repository.",
min_length=1,
json_schema_extra={"metadata": {"immutable_after_creation": True}},
json_schema_extra={
"metadata": {
"immutable_after_creation": True,
"tooltip_message": "The GitHub repository to be created. If the name contains spaces or special characters, GitHub will adjust it according to its naming rules. A random suffix will be added if the repository name already exists.",
}
},
),
]

Expand All @@ -50,7 +62,12 @@ class Deployment(Model):
description="The name of the Fly.io application.",
min_length=1,
max_length=30,
json_schema_extra={"metadata": {"immutable_after_creation": True}},
json_schema_extra={
"metadata": {
"immutable_after_creation": True,
"tooltip_message": "The Fly.io application. This will be used to create and deploy your React, Node.js, and PostgreSQL apps to Fly.io.",
}
},
),
]

Expand All @@ -59,22 +76,37 @@ class Deployment(Model):
Field(
title="Team Name",
description="The team that is used in the deployment",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the team to be used for deployment. User messages are sent to the Initial agent of the chosen team, and the agent's responses are sent back to the user. This field can be updated anytime to switch teams, with changes reflected in real-time in your deployments."
}
},
),
]
gh_token: Annotated[
GitHubTokenRef,
Field(
title="GH Token",
description="The GitHub token to use for creating a new repository",
json_schema_extra={"metadata": {"immutable_after_creation": True}},
json_schema_extra={
"metadata": {
"immutable_after_creation": True,
"tooltip_message": "Choose the GitHub token used for authenticating and managing access to your GitHub account.",
}
},
),
]
fly_token: Annotated[
FlyTokenRef,
Field(
title="Fly Token",
description="The Fly.io token to use for deploying the deployment",
json_schema_extra={"metadata": {"immutable_after_creation": True}},
json_schema_extra={
"metadata": {
"immutable_after_creation": True,
"tooltip_message": "Choose the Fly.io token used for authenticating and managing access to your Fly.io account.",
}
},
),
]

Expand Down
33 changes: 31 additions & 2 deletions fastagency/studio/models/llms/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class AnthropicAPIKey(Model):
Field(
title="API Key",
description="The API Key from Anthropic",
json_schema_extra={
"metadata": {
"tooltip_message": "The API key specified here will be used to authenticate requests to Anthropic services."
}
},
),
]

Expand Down Expand Up @@ -57,7 +62,12 @@ class Anthropic(Model):
model: Annotated[ # type: ignore[valid-type]
AnthropicModels,
Field(
description="The model to use for the Anthropic API, e.g. 'claude-3-5-sonnet-20240620'"
description="The model to use for the Anthropic API, e.g. 'claude-3-5-sonnet-20240620'",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the model that the LLM should use to generate responses."
}
},
),
] = "claude-3-5-sonnet-20240620"

Expand All @@ -66,11 +76,25 @@ class Anthropic(Model):
Field(
title="API Key",
description="The API Key from Anthropic",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the API key that will be used to authenticate requests to Anthropic services."
}
},
),
]

base_url: Annotated[
URL, Field(title="Base URL", description="The base URL of the Anthropic API")
URL,
Field(
title="Base URL",
description="The base URL of the Anthropic API",
json_schema_extra={
"metadata": {
"tooltip_message": "The base URL that the LLM uses to interact with Anthropic services."
}
},
),
] = URL(url="https://api.anthropic.com/v1")

api_type: Annotated[
Expand All @@ -82,6 +106,11 @@ class Anthropic(Model):
float,
Field(
description="The temperature to use for the model, must be between 0 and 2",
json_schema_extra={
"metadata": {
"tooltip_message": "Adjust the temperature to change the response style. Lower values lead to more consistent answers, while higher values make the responses more creative. The values must be between 0 and 2."
}
},
ge=0.0,
le=2.0,
),
Expand Down
49 changes: 45 additions & 4 deletions fastagency/studio/models/llms/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@
@register("secret")
class AzureOAIAPIKey(Model):
api_key: Annotated[
str, Field(title="API Key", description="The API Key from Azure OpenAI")
str,
Field(
title="API Key",
description="The API Key from Azure OpenAI",
json_schema_extra={
"metadata": {
"tooltip_message": "The API key specified here will be used to authenticate requests to Azure OpenAI services."
}
},
),
]

@classmethod
Expand Down Expand Up @@ -57,17 +66,39 @@ class AzureOAI(Model):
model: Annotated[
str,
Field(
description="The model to use for the Azure OpenAI API, e.g. 'gpt-3.5-turbo'"
description="The model to use for the Azure OpenAI API, e.g. 'gpt-3.5-turbo'",
json_schema_extra={
"metadata": {
"tooltip_message": "The model that the LLM uses to interact with Azure OpenAI services."
}
},
),
] = "gpt-3.5-turbo"

api_key: Annotated[
AzureOAIAPIKeyRef,
Field(title="API Key", description="The API Key from Azure OpenAI"),
Field(
title="API Key",
description="The API Key from Azure OpenAI",
json_schema_extra={
"metadata": {
"tooltip_message": "Choose the API key that will be used to authenticate requests to Azure OpenAI services."
}
},
),
]

base_url: Annotated[
URL, Field(title="Base URL", description="The base URL of the Azure OpenAI API")
URL,
Field(
title="Base URL",
description="The base URL of the Azure OpenAI API",
json_schema_extra={
"metadata": {
"tooltip_message": "The base URL that the LLM uses to interact with Azure OpenAI services."
}
},
),
] = UrlModel(url="https://{your-resource-name}.openai.azure.com").url

api_type: Annotated[
Expand All @@ -80,13 +111,23 @@ class AzureOAI(Model):
Field(
title="API Version",
description="The version of the Azure OpenAI API, e.g. '2024-02-01'",
json_schema_extra={
"metadata": {
"tooltip_message": "The version of the Azure OpenAI API that the LLM uses to interact with Azure OpenAI services."
}
},
),
] = "2024-02-01"

temperature: Annotated[
float,
Field(
description="The temperature to use for the model, must be between 0 and 2",
json_schema_extra={
"metadata": {
"tooltip_message": "Adjust the temperature to change the response style. Lower values lead to more consistent answers, while higher values make the responses more creative. The values must be between 0 and 2."
}
},
ge=0.0,
le=2.0,
),
Expand Down
Loading

0 comments on commit 24da69f

Please sign in to comment.