feat: add docker compose file
1、docker file 2、docker compose with MongoRepository and keycloak sso
This commit is contained in:
parent
f34249801d
commit
c2a81fe4c0
|
|
@ -1,4 +1,10 @@
|
|||
|
||||
# MongoDB Configuration
|
||||
ENV_MONGO_DB_HOST=botsharp_mongo
|
||||
ENV_MONGO_DB_PORT=27017
|
||||
ENV_MONGO_DB_DATABASE=botsharp
|
||||
ENV_MONGO_INITDB_ROOT_USERNAME=root
|
||||
ENV_MONGO_INITDB_ROOT_PASSWORD=admin
|
||||
ASPNETCORE_HTTP_PORTS=5500
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
16
dockerfiles/Readme.md
Normal file
16
dockerfiles/Readme.md
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
## Run Container
|
||||
|
||||
# Prerequisites:
|
||||
1. Install Powershell
|
||||
2. Install Docker Environment
|
||||
|
||||
# start container
|
||||
|
||||
```
|
||||
run-docker-compose.ps1
|
||||
```
|
||||
|
||||
# stop container
|
||||
```
|
||||
stop-docker-compose.ps1
|
||||
```
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
|
||||
USER app
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 5500
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
|
|
|
|||
|
|
@ -6,11 +6,32 @@
|
|||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"AllowedOrigins": [
|
||||
"http://localhost:5015"
|
||||
],
|
||||
|
||||
"Jwt": {
|
||||
"Issuer": "botsharp",
|
||||
"Audience": "botsharp",
|
||||
"Key": "31ba6052aa6f4569901facc3a41fcb4a"
|
||||
"Key": "31ba6052aa6f4569901facc3a41fcb4adfd9b46dd00c40af8a753fbdc2b89869"
|
||||
},
|
||||
|
||||
"OAuth": {
|
||||
"GitHub": {
|
||||
"ClientId": "",
|
||||
"ClientSecret": ""
|
||||
},
|
||||
"Google": {
|
||||
"ClientId": "",
|
||||
"ClientSecret": ""
|
||||
},
|
||||
"Keycloak": {
|
||||
"BaseAddress": "http://keycloak.localhost:8080",
|
||||
"Realm": "master",
|
||||
"ClientId": "botsharp",
|
||||
"ClientSecret": "36FeOoyZzkOWrRZLmhwxplC2kGbFGn68",
|
||||
"Version": 22
|
||||
}
|
||||
},
|
||||
|
||||
"LlmProviders": [
|
||||
|
|
@ -26,14 +47,36 @@
|
|||
"CompletionCost": 0.002
|
||||
},
|
||||
{
|
||||
"Name": "gpt-35-turbo",
|
||||
"Name": "gpt-35-turbo-instruct",
|
||||
"ApiKey": "",
|
||||
"Endpoint": "https://ai4c-demo.openai.azure.com/",
|
||||
"Endpoint": "https://gpt-35-turbo-instruct.openai.azure.com/",
|
||||
"Type": "text",
|
||||
"PromptCost": 0.0015,
|
||||
"CompletionCost": 0.002
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Provider": "llama-sharp",
|
||||
"Models": [
|
||||
{
|
||||
"Name": "llama-2-7b-guanaco-qlora.Q2_K.gguf",
|
||||
"Type": "chat"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Provider": "huggingface",
|
||||
"Models": [
|
||||
{
|
||||
"Name": "mistralai/Mistral-7B-v0.1",
|
||||
"Type": "text"
|
||||
},
|
||||
{
|
||||
"Name": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
||||
"Type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
|
|
@ -58,7 +101,13 @@
|
|||
"DataDir": "conversations",
|
||||
"ShowVerboseLog": false,
|
||||
"EnableLlmCompletionLog": false,
|
||||
"EnableExecutionLog": true
|
||||
"EnableExecutionLog": true,
|
||||
"EnableContentLog": true,
|
||||
"EnableStateLog": true
|
||||
},
|
||||
|
||||
"Statistics": {
|
||||
"DataDir": "stats"
|
||||
},
|
||||
|
||||
"LlamaSharp": {
|
||||
|
|
@ -110,9 +159,9 @@
|
|||
},
|
||||
|
||||
"Database": {
|
||||
"Default": "FileRepository",
|
||||
"Default": "MongoRepository",
|
||||
"TablePrefix": "BotSharp",
|
||||
"BotSharpMongoDb": "",
|
||||
"BotSharpMongoDb": "mongodb://root:admin@botsharp_mongo:27017/botsharp?authSource=admin&authMechanism=SCRAM-SHA-256",
|
||||
"FileRepository": "data",
|
||||
"Assemblies": [ "BotSharp.Core" ]
|
||||
},
|
||||
|
|
@ -139,8 +188,10 @@
|
|||
|
||||
"PluginLoader": {
|
||||
"Assemblies": [
|
||||
"BotSharp.Plugin.MongoStorage",
|
||||
"BotSharp.Core",
|
||||
"BotSharp.Logger",
|
||||
"BotSharp.Plugin.MongoStorage",
|
||||
"BotSharp.Plugin.Dashboard",
|
||||
"BotSharp.Plugin.AzureOpenAI",
|
||||
"BotSharp.Plugin.GoogleAI",
|
||||
"BotSharp.Plugin.MetaAI",
|
||||
|
|
@ -155,4 +206,4 @@
|
|||
"BotSharp.Plugin.LLamaSharp"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
64
dockerfiles/botsharp.json
Normal file
64
dockerfiles/botsharp.json
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"clientId": "botsharp",
|
||||
"name": "botsharp 登陆",
|
||||
"description": "",
|
||||
"rootUrl": "http://localhost:5500",
|
||||
"adminUrl": "http://localhost:5500",
|
||||
"baseUrl": "http://localhost:5500",
|
||||
"surrogateAuthRequired": false,
|
||||
"enabled": true,
|
||||
"alwaysDisplayInConsole": true,
|
||||
"clientAuthenticatorType": "client-secret",
|
||||
"secret": "36FeOoyZzkOWrRZLmhwxplC2kGbFGn68",
|
||||
"redirectUris": [
|
||||
"http://localhost:5500/*"
|
||||
],
|
||||
"webOrigins": [
|
||||
"http://localhost:5500"
|
||||
],
|
||||
"notBefore": 0,
|
||||
"bearerOnly": false,
|
||||
"consentRequired": false,
|
||||
"standardFlowEnabled": true,
|
||||
"implicitFlowEnabled": false,
|
||||
"directAccessGrantsEnabled": true,
|
||||
"serviceAccountsEnabled": false,
|
||||
"publicClient": false,
|
||||
"frontchannelLogout": true,
|
||||
"protocol": "openid-connect",
|
||||
"attributes": {
|
||||
"client.secret.creation.time": "1708154349",
|
||||
"oauth2.device.authorization.grant.enabled": "false",
|
||||
"backchannel.logout.revoke.offline.tokens": "false",
|
||||
"use.refresh.tokens": "true",
|
||||
"oidc.ciba.grant.enabled": "false",
|
||||
"backchannel.logout.session.required": "true",
|
||||
"client_credentials.use_refresh_token": "false",
|
||||
"tls.client.certificate.bound.access.tokens": "false",
|
||||
"require.pushed.authorization.requests": "false",
|
||||
"acr.loa.map": "{}",
|
||||
"display.on.consent.screen": "false",
|
||||
"token.response.type.bearer.lower-case": "false"
|
||||
},
|
||||
"authenticationFlowBindingOverrides": {},
|
||||
"fullScopeAllowed": true,
|
||||
"nodeReRegistrationTimeout": -1,
|
||||
"defaultClientScopes": [
|
||||
"web-origins",
|
||||
"acr",
|
||||
"profile",
|
||||
"roles",
|
||||
"email"
|
||||
],
|
||||
"optionalClientScopes": [
|
||||
"address",
|
||||
"phone",
|
||||
"offline_access",
|
||||
"microprofile-jwt"
|
||||
],
|
||||
"access": {
|
||||
"view": true,
|
||||
"configure": true,
|
||||
"manage": true
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"id": "01e2fc5c-2c89-4ec7-8470-7688608b496c",
|
||||
"name": "Chatbot",
|
||||
"description": "Chatbot is used to test the performance of different large models and does not interact with external APIs.",
|
||||
"type": "task",
|
||||
"createdDateTime": "2024-01-15T10:39:32Z",
|
||||
"updatedDateTime": "2024-01-15T14:39:32Z",
|
||||
"iconUrl": "/images/logo.png",
|
||||
"disabled": false,
|
||||
"isPublic": true
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
You are a AI Assistant. You can answer user's question.
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"id": "01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a",
|
||||
"name": "AI Assistant",
|
||||
"description": "AI assistant that can complete many different tasks",
|
||||
"type": "routing",
|
||||
"createdDateTime": "2023-08-18T10:39:32.2349685Z",
|
||||
"updatedDateTime": "2023-08-18T14:39:32.2349686Z",
|
||||
"iconUrl": "https://cdn.iconscout.com/icon/premium/png-256-thumb/route-1613278-1368497.png",
|
||||
"disabled": false,
|
||||
"isPublic": true,
|
||||
"profiles": [ "tool" ],
|
||||
"routingRules": [
|
||||
{
|
||||
"type": "planner",
|
||||
"field": "HFPlanner"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
You're {{router.name}} ({{router.description}}). Follow these steps to handle user request:
|
||||
1. Read the [CONVERSATION] content.
|
||||
2. Select a appropriate function from [FUNCTIONS].
|
||||
3. Determine which agent is suitable to handle this conversation.
|
||||
4. Re-think on whether the function you chose matches the reason.
|
||||
5. For agent required arguments, leave it as blank object if user doesn't provide it.
|
||||
6. Response must be in JSON format.
|
||||
|
||||
[FUNCTIONS]
|
||||
{% for handler in routing_handlers %}
|
||||
# {{ handler.description}}
|
||||
{% if handler.parameters and handler.parameters != empty -%}
|
||||
Parameters:
|
||||
- function: {{ handler.name }}
|
||||
{% for p in handler.parameters -%}
|
||||
- {{ p.name }}: {{ p.description }}{{ "\r\n " }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{% endfor %}
|
||||
|
||||
[AGENTS]
|
||||
{% for agent in routing_agents %}
|
||||
* Agent: {{ agent.name }}
|
||||
{{ agent.description}}
|
||||
{% if agent.required_fields and agent.required_fields != empty -%}
|
||||
Required args:
|
||||
{% for f in agent.required_fields -%}
|
||||
- {{ f.name }} (type: {{ f.type }}): {{ f.description }}{{ "\r\n " }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{% if agent.optional_fields and agent.optional_fields != empty -%}
|
||||
Optional args:
|
||||
{% for f in agent.optional_fields -%}
|
||||
- {{ f.name }} (type: {{ f.type }}): {{ f.description }}{{ "\r\n " }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{% endfor %}
|
||||
|
||||
[CONVERSATION]
|
||||
{{ conversation }}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
[
|
||||
{
|
||||
"text": "Hello, I'm an AI assistant that help you do variety of tasks."
|
||||
},
|
||||
{
|
||||
"rich_type": "quick_reply",
|
||||
"text": "How can I help you today?",
|
||||
"quick_replies": [
|
||||
{
|
||||
"title":"Access website",
|
||||
"payload":"Launch Browser"
|
||||
},
|
||||
{
|
||||
"title":"Who are you?",
|
||||
"payload":"who are you?"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1 @@
|
|||
Break down the user’s most recent needs and figure out the next steps.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
What is the next step based on the CONVERSATION?
|
||||
Route to the Agent that last handled the conversation if necessary.
|
||||
If user wants to speak to customer service, use function human_intervention_needed.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
User will give you a task list with steps, which is going to be executed.
|
||||
If a specific step has been exectued, you will get something indicates the result.
|
||||
If there is no any result provided, it means all the steps have not been executed yet.
|
||||
You need to figure out which steps have not been completed.
|
||||
Tell me what is the first remaining step from user steps that have not been completed based on the context.
|
||||
Output in JSON
|
||||
{
|
||||
"description": "step detail with arguments",
|
||||
"total_remaining_steps": 0,
|
||||
"should_stop": false,
|
||||
"stop_reason": "the reason why it should stop"
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
In order to sequentially execute user tasks,
|
||||
What is the next step based on the CONVERSATION?
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Output Requirements]
|
||||
1. Read the [Functions] definition, you can utilize the function to retrieve data or execute actions.
|
||||
2. Think step by step, check if specific function will provider data to help complete user request based on the conversation.
|
||||
3. If you need to call a function to decide how to response user,
|
||||
response in format: {"role": "function", "reason":"why choose this function", "function_name": "", "args": {}},
|
||||
otherwise response in format: {"role": "assistant", "reason":"why response to user", "content":"next step question"}.
|
||||
4. If the conversation already contains the function execution result, don't need to call it again.
|
||||
5. If user mentioned some specific requirment, don't ask this question in your response.
|
||||
6. Don't repeat the same question in your response.
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"id": "87c458fc-ec5f-40ae-8ed6-05dda8a07523",
|
||||
"name": "HTTP Handler",
|
||||
"description": "Use Web Open API to interact with 3rd system.",
|
||||
"type": "task",
|
||||
"createdDateTime": "2024-01-06T00:00:00Z",
|
||||
"updatedDateTime": "2024-01-06T00:00:00Z",
|
||||
"disabled": false,
|
||||
"isPublic": true,
|
||||
"profiles": [ "tool", "webapi" ],
|
||||
"llmConfig": {
|
||||
"max_recursion_depth": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[
|
||||
|
||||
]
|
||||
|
|
@ -0,0 +1 @@
|
|||
You are an HTTP handler and know how to use Open API to interact with other systems.
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"id": "8970b1e5-d260-4e2c-90b1-f1415a257c18",
|
||||
"name": "Pizza Bot",
|
||||
"description": "AI assistant that can help customer place pizza order.",
|
||||
"type": "routing",
|
||||
"inheritAgentId": "01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a",
|
||||
"createdDateTime": "2023-08-18T10:39:32.2349685Z",
|
||||
"updatedDateTime": "2023-08-18T14:39:32.2349686Z",
|
||||
"iconUrl": "https://cdn-icons-png.flaticon.com/512/6978/6978255.png",
|
||||
"disabled": true,
|
||||
"isPublic": true,
|
||||
"profiles": [ "pizza" ],
|
||||
"routingRules": [
|
||||
{
|
||||
"type": "planner",
|
||||
"field": "NaviePlanner"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
Role: You're a customer who is going to buy a pizza.
|
||||
* You like pepperoni flavor.
|
||||
* You will pay the order in cash.
|
||||
* Your address is 347 S Gladstone Ave, Aurora, IL 60506.
|
||||
* Your phone number is +16308926431
|
||||
|
||||
Requirments:
|
||||
* Greeting to clerk.
|
||||
* You want to know what kind of pizza do they have.
|
||||
* You want to buy three piece of pizza.
|
||||
* Say Bye if the order is placed and payment is completed.
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "Order Inquiry",
|
||||
"description": "Check the order status like payment, delivery or baking.",
|
||||
"createdDateTime": "2023-08-18T14:39:32.2349685Z",
|
||||
"updatedDateTime": "2023-08-18T14:39:32.2349686Z",
|
||||
"id": "b284db86-e9c2-4c25-a59e-4649797dd130",
|
||||
"disabled": true,
|
||||
"isPublic": true,
|
||||
"profiles": [ "pizza" ],
|
||||
"routingRules": [
|
||||
{
|
||||
"field": "order_number",
|
||||
"description": "order number",
|
||||
"type": "string",
|
||||
"redirectTo": "c2b57a74-ae4e-4c81-b3ad-9ac5bff982bd"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
[
|
||||
{
|
||||
"name": "get_order_status",
|
||||
"description": "get order status like delivery remaining time",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_number": {
|
||||
"type": "string",
|
||||
"description": "order number."
|
||||
}
|
||||
},
|
||||
"required": ["order_number"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
You're a Order Inquiry agent to tell user current status of the specific order.
|
||||
|
||||
You can also access below available information related to current order to answer user's questions:
|
||||
* Today is {{current_date}}, the time now is {{current_time}}, today is {{current_weekday}}.
|
||||
{% if phone_num %}* Phone number is: {{phone_num}}.{% endif %}
|
||||
{% if order_number %}* order number is: {{order_number}}.{% endif %}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"id": "beda4c12-e1ec-4b4b-b328-3df4a6687c4f",
|
||||
"name": "SQL Driver",
|
||||
"description": "Convert the requirements into corresponding SQL statements according to the table structure and execute them if needed.",
|
||||
"type": "task",
|
||||
"createdDateTime": "2023-11-15T13:49:00Z",
|
||||
"updatedDateTime": "2023-11-15T13:49:00Z",
|
||||
"disabled": false,
|
||||
"isPublic": false,
|
||||
"profiles": [ "tool", "sql" ],
|
||||
"llmConfig": {
|
||||
"max_recursion_depth": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
[{
|
||||
"name": "execute_sql",
|
||||
"description": "generate sql statement and execute the query.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sql_statement": {
|
||||
"type": "string",
|
||||
"description": "SQL statement"
|
||||
}
|
||||
},
|
||||
"required": ["sql_statement"]
|
||||
}
|
||||
}]
|
||||
|
|
@ -0,0 +1 @@
|
|||
You are a SQL Driver who knows how to convert human language to SQL statements.
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "Ordering",
|
||||
"description": "Provide types of pizza available, unit price and total cost. Place the order and returned the order number.",
|
||||
"createdDateTime": "2023-07-26T02:29:25.123224Z",
|
||||
"updatedDateTime": "2023-07-26T02:29:25.123274Z",
|
||||
"id": "c2b57a74-ae4e-4c81-b3ad-9ac5bff982bd",
|
||||
"disabled": true,
|
||||
"isPublic": true,
|
||||
"profiles": [ "pizza" ]
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
[
|
||||
{
|
||||
"name": "get_pizza_price",
|
||||
"description": "call this function to get the pizza price",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pizza_type": {
|
||||
"type": "string",
|
||||
"description": "The pizza type."
|
||||
},
|
||||
"quantity": {
|
||||
"type": "string",
|
||||
"description": "quantity of pizza."
|
||||
}
|
||||
},
|
||||
"required": ["pizza_type", "quantity"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_pizza_types",
|
||||
"description": "get all pizza types",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "place_an_order",
|
||||
"description": "Place an order when user has confirmed the pizza type and quantity.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pizza_type": {
|
||||
"type": "string",
|
||||
"description": "The pizza type."
|
||||
},
|
||||
"quantity": {
|
||||
"type": "number",
|
||||
"description": "quantity of pizza."
|
||||
},
|
||||
"unit_price": {
|
||||
"type": "number",
|
||||
"description": "unit price"
|
||||
}
|
||||
},
|
||||
"required": ["pizza_type", "quantity", "unit_price"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
You are now a Pizza Ordering agent, and you can help customers order a pizza according to the user's preferences.
|
||||
|
||||
Follow below step to place order:
|
||||
1: Ask user preferences, call function get_pizza_types to provide the variety of pizza options.
|
||||
2: Confirm with user the pizza type and quantity.
|
||||
3: Call function place_an_order to purchase.
|
||||
4: Ask user how to pay for this order.
|
||||
|
||||
Use below information to help ordering process:
|
||||
* Today is {{current_date}}, the time now is {{current_time}}, day of week is {{current_weekday}}.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{% assign pizza_type = pizza_type | downcase %}
|
||||
{% if pizza_type contains "cheese" -%}
|
||||
The price for a slice of {{pizza_type}} pizza is ${{ cheese_unit_price }}. Would you like to proceed the order?
|
||||
{%- elsif pizza_type contains "pepperoni" -%}
|
||||
The price for a slice of {{pizza_type}} pizza is ${{ pepperoni_unit_price }}. Would you like to proceed the order?
|
||||
{%- elsif pizza_type contains "margherita" -%}
|
||||
The price for a slice of {{pizza_type}} pizza is ${{ margherita_unit_price }}. Would you like to proceed the order?
|
||||
{%- else -%}
|
||||
We don't have {{pizza_type}} pizza, would you like something else?
|
||||
{%- endif %}
|
||||
{% if quantity == nil -%}
|
||||
How many slices would you like to order?
|
||||
{%- endif %}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"id": "dfd9b46d-d00c-40af-8a75-3fbdc2b89869",
|
||||
"name": "Evaluator",
|
||||
"description": "Evaluate the performance of the LLM agents",
|
||||
"createdDateTime": "2023-08-18T00:00:00Z",
|
||||
"updatedDateTime": "2023-08-18T00:00:00Z",
|
||||
"disabled": true,
|
||||
"llmConfig": {
|
||||
"model": "gpt-35-turbo-instruct"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
This is a model evaluation program, which interactive with model to complete a certain task based on the background information given to you.
|
||||
|
||||
{{ task_prompt }}
|
||||
|
||||
user: Hi!
|
||||
assistant: Hello, How can I help you?
|
||||
user:
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
This is a model executing program, which interactive with model to complete a certain task based on the background information given to you.
|
||||
|
||||
{{ task_prompt }}
|
||||
|
||||
user: Hi!
|
||||
assistant: Hello, How can I help you?
|
||||
user:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
You are a task reviewer. You analyze the user's intention through the [CONVERSAION] and then generate the corresponding information to verify the result.
|
||||
|
||||
[CONVERSAION]
|
||||
{{ execution_log }}
|
||||
|
||||
Populate values to validate the result. Response in JSON format: {
|
||||
"is_conversation_end": "True or False",
|
||||
"validation_parameters: "fields used to call validation function"
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"id": "f3ae2a0f-e6ba-4ee1-a0b9-75d7431ff32b",
|
||||
"name": "Web Driver",
|
||||
"description": "Perform the web page related task in browser by using automation tools.",
|
||||
"type": "task",
|
||||
"createdDateTime": "2024-01-02T00:00:00Z",
|
||||
"updatedDateTime": "2024-01-02T00:00:00Z",
|
||||
"disabled": false,
|
||||
"isPublic": true,
|
||||
"profiles": [ "tool", "browser" ],
|
||||
"llmConfig": {
|
||||
"max_recursion_depth": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,228 @@
|
|||
[
|
||||
{
|
||||
"name": "open_browser",
|
||||
"description": "open a browser",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "website url starts with https://"
|
||||
}
|
||||
},
|
||||
"required": [ "url" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "close_browser",
|
||||
"description": "Close browser",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "go_to_page",
|
||||
"description": "go to another page",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "page url start with https://"
|
||||
}
|
||||
},
|
||||
"required": [ "url" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "scroll_page",
|
||||
"description": "Scroll page down or up",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"direction": {
|
||||
"type": "string",
|
||||
"description": "down, up, left, right"
|
||||
}
|
||||
},
|
||||
"required": [ "direction" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "take_screenshot",
|
||||
"description": "Tak screenshot to show current page screen",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "click_button",
|
||||
"description": "Click a button in a web page.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element_name": {
|
||||
"type": "string",
|
||||
"description": "the html element name."
|
||||
}
|
||||
},
|
||||
"required": [ "element_name" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "extract_data_from_page",
|
||||
"description": "Extract data from current web page.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"question": {
|
||||
"type": "string",
|
||||
"description": "the information user wants to know"
|
||||
}
|
||||
},
|
||||
"required": [ "question" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "input_user_text",
|
||||
"description": "Input non-sensitive text in current web page.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element_text": {
|
||||
"type": "string",
|
||||
"description": "text or placeholder shown in the element."
|
||||
},
|
||||
"input_text": {
|
||||
"type": "string",
|
||||
"description": "non-sensitive text user provided."
|
||||
},
|
||||
"press_enter": {
|
||||
"type": "boolean",
|
||||
"description": "whether to press Enter key"
|
||||
},
|
||||
"attribute_name": {
|
||||
"type": "string",
|
||||
"description": "attribute name in the element"
|
||||
},
|
||||
"attribute_value": {
|
||||
"type": "string",
|
||||
"description": "attribute value in the element"
|
||||
}
|
||||
},
|
||||
"required": [ "element_text", "input_text" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "change_list_value",
|
||||
"description": "Update value from dropdown list or radio button",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element_name": {
|
||||
"type": "string",
|
||||
"description": "the html selection element name."
|
||||
},
|
||||
"update_value": {
|
||||
"type": "string",
|
||||
"description": "the value in the list."
|
||||
}
|
||||
},
|
||||
"required": [ "element_name", "update_value" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "input_user_password",
|
||||
"description": "Input password in current web page",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string",
|
||||
"description": "user password"
|
||||
}
|
||||
},
|
||||
"required": [ "password" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "change_checkbox",
|
||||
"description": "Check or uncheck checkbox",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element_text": {
|
||||
"type": "string",
|
||||
"description": "the element title"
|
||||
},
|
||||
"update_value": {
|
||||
"type": "string",
|
||||
"description": "check or uncheck"
|
||||
},
|
||||
"match_rule": {
|
||||
"type": "string",
|
||||
"description": "text matching rule: EndWith, StartWith, Contains, Match"
|
||||
}
|
||||
},
|
||||
"required": [ "element_text", "update_value", "match_rule" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "click_element",
|
||||
"description": "Click or check an element contains some text",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element_type": {
|
||||
"type": "string",
|
||||
"description": "the element tag name"
|
||||
},
|
||||
"element_text": {
|
||||
"type": "string",
|
||||
"description": "text or placeholder shown in the element."
|
||||
},
|
||||
"attribute_name": {
|
||||
"type": "string",
|
||||
"description": "attribute name in the element"
|
||||
},
|
||||
"attribute_value": {
|
||||
"type": "string",
|
||||
"description": "attribute value in the element"
|
||||
},
|
||||
"match_rule": {
|
||||
"type": "string",
|
||||
"description": "text matching rule: EndWith, StartWith, Contains, Match"
|
||||
}
|
||||
},
|
||||
"required": [ "element_type", "element_text", "match_rule" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "check_radio_button",
|
||||
"description": "Check value in a radio button",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element_text": {
|
||||
"type": "string",
|
||||
"description": "the element title"
|
||||
},
|
||||
"update_value": {
|
||||
"type": "string",
|
||||
"description": "the value in the radio button."
|
||||
},
|
||||
"match_rule": {
|
||||
"type": "string",
|
||||
"description": "text matching rule: EndWith, StartWith, Contains, Match"
|
||||
}
|
||||
},
|
||||
"required": [ "update_value", "element_text", "match_rule" ]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
You are a Web Driver that can manipulate web elements through automation tools.
|
||||
|
||||
Follow below steps to response:
|
||||
1. Analyze user's request.
|
||||
2. Call appropriate function to execute the instruction.
|
||||
3. If user requests execute multiple steps, execute them sequentially.
|
||||
|
||||
Additional response requirements:
|
||||
* Call function input_user_password if user wants to input password.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{{ content }}
|
||||
|
||||
=== According to above text ===
|
||||
Find the answer of "{{ question }}"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{{ html_content }}
|
||||
|
||||
=== According to above HTML ===
|
||||
Find the html element in the similar meaning of "{{ element_name }}".
|
||||
Output in JSON format {"tag_name": "", "element_id": "the id attribute", "element_name", "the name attribute", "index": -1}.
|
||||
The index is the position of the element which starts with 0.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "Knowledge Base",
|
||||
"description": "Local knowledge base, providing relevant answers or background knowledge to help handle user questions.",
|
||||
"createdDateTime": "2024-01-02T00:00:00Z",
|
||||
"updatedDateTime": "2024-01-02T00:00:00Z",
|
||||
"id": "f5679799-ba89-4fef-936a-bcc311e5f14d",
|
||||
"allowRouting": true,
|
||||
"isPublic": true
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
[
|
||||
{
|
||||
"name": "search_knowledges",
|
||||
"description": "Retrieve relevant knowledges",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"question": {
|
||||
"type": "string",
|
||||
"description": "User question"
|
||||
}
|
||||
},
|
||||
"required": ["question"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1 @@
|
|||
You are a local knowledge base that retrieves the most relevant answers to certain questions.
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "Payment",
|
||||
"description": "Make payment when user wants to pay for the order",
|
||||
"createdDateTime": "2023-07-26T02:29:25.123224Z",
|
||||
"updatedDateTime": "2023-07-26T02:29:25.123274Z",
|
||||
"id": "fe8c60aa-b114-4ef3-93cb-a8efeac80f75",
|
||||
"disabled": true,
|
||||
"isPublic": true,
|
||||
"profiles": [ "pizza" ],
|
||||
"routingRules": [
|
||||
{
|
||||
"field": "order_number",
|
||||
"description": "order number",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"redirectTo": "c2b57a74-ae4e-4c81-b3ad-9ac5bff982bd"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
[
|
||||
{
|
||||
"name": "make_payment",
|
||||
"description": "call this function to make payment",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_number": {
|
||||
"type": "string",
|
||||
"description": "order number."
|
||||
},
|
||||
"total_amount": {
|
||||
"type": "string",
|
||||
"description": "total amount."
|
||||
}
|
||||
},
|
||||
"required": ["order_number", "total_amount"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1 @@
|
|||
You are now a Casher, handle order payment.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"id": "6bd19bda-fdae-434c-8ddf-788ee5e6ff4f",
|
||||
"agentId": "01e2fc5c-2c89-4ec7-8470-7688608b496c",
|
||||
"userId": "456e35c5-caf0-4d45-9084-b44a8ca717e4",
|
||||
"taskId": null,
|
||||
"title": "你好,我可以问下pdf 文件用什么软件打开 ",
|
||||
"status": "open",
|
||||
"channel": "openapi",
|
||||
"updatedTime": "2024-02-18T08:18:29.2088118Z",
|
||||
"createdTime": "2024-02-18T08:13:10.8880785Z"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
02/18/2024 08:18:20.752 AM|user|01e2fc5c-2c89-4ec7-8470-7688608b496c|c7fc2ae0-cc22-4846-93d1-ee17d34537ed|456e35c5-caf0-4d45-9084-b44a8ca717e4
|
||||
- 你好,我可以问下pdf 文件用什么软件打开
|
||||
02/18/2024 08:18:29.163 AM|assistant|01e2fc5c-2c89-4ec7-8470-7688608b496c|c7fc2ae0-cc22-4846-93d1-ee17d34537ed|
|
||||
- 你好!你可以使用许多不同的软件来打开PDF文件。以下是一些常见的选择: 1. Adobe Acrobat Reader:这是最常用的PDF阅读器,可以在Adobe官方网站上免费下载。 2. Foxit Reader:这是另一个流行的免费PDF阅读器,也可以在其官方网站上下载。 3. Google Chrome:如果你使用的是Chrome浏览器,它已经内置了一个PDF阅读器。只需在浏览器中打开PDF文件即可。 4. Microsoft Edge:Windows 10操作系统中的默认浏览器,也具有内置的PDF阅读器。 5. Preview(预览):这是苹果电脑上的默认PDF阅读器,可以在Mac电脑上直接打开PDF文件。 除了这些,还有许多其他的PDF阅读器可供选择,你可以根据自己的需求和喜好选择适合你的软件。
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
[
|
||||
{
|
||||
"key": "channel",
|
||||
"values": [
|
||||
{
|
||||
"data": "openapi",
|
||||
"updateTime": "2024-02-18T08:18:20.7601253Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"values": [
|
||||
{
|
||||
"data": "0.5",
|
||||
"updateTime": "2024-02-18T08:18:20.7613053Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "sampling_factor",
|
||||
"values": [
|
||||
{
|
||||
"data": "0.5",
|
||||
"updateTime": "2024-02-18T08:18:20.7613341Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "prompt_total",
|
||||
"values": [
|
||||
{
|
||||
"data": "41",
|
||||
"updateTime": "2024-02-18T08:18:29.1630906Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "completion_total",
|
||||
"values": [
|
||||
{
|
||||
"data": "261",
|
||||
"updateTime": "2024-02-18T08:18:29.1630967Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "llm_total_cost",
|
||||
"values": [
|
||||
{
|
||||
"data": "0.0005835",
|
||||
"updateTime": "2024-02-18T08:18:29.1631479Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
BIN
dockerfiles/data/models/dbpedia.ftz
Normal file
BIN
dockerfiles/data/models/dbpedia.ftz
Normal file
Binary file not shown.
BIN
dockerfiles/data/models/intent-classifier.h5
Normal file
BIN
dockerfiles/data/models/intent-classifier.h5
Normal file
Binary file not shown.
3
dockerfiles/data/models/label.txt
Normal file
3
dockerfiles/data/models/label.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
goodbye
|
||||
greeting
|
||||
other
|
||||
7
dockerfiles/data/plugins/config.json
Normal file
7
dockerfiles/data/plugins/config.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"enabledPlugins": [
|
||||
"6e52d42d-1e23-406b-8599-36af36c83209",
|
||||
"d42a0c21-b461-44f6-ada2-499510d260af",
|
||||
"058094a7-4ad3-4284-b94d-ac1373cf63d8"
|
||||
]
|
||||
}
|
||||
5
dockerfiles/data/stats/2024/02/0218-stats.json
Normal file
5
dockerfiles/data/stats/2024/02/0218-stats.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"id": "49b0b681-b828-4cf3-ba02-7f7f0953a2b6",
|
||||
"conversationCount": 1,
|
||||
"updatedDateTime": "2024-02-18T08:13:11.1001016Z"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"userName": "guest",
|
||||
"firstName": "Guest",
|
||||
"lastName": "Anonymous",
|
||||
"email": "guest@gmail.com",
|
||||
"salt": "55f8fafcf829479ca97e635937440fee",
|
||||
"password": "3b459ae9988628d41f0362c499a768dd",
|
||||
"role": "client",
|
||||
"updatedTime": "2023-11-13T18:00:00Z",
|
||||
"createdTime": "2023-11-13T18:00:00Z",
|
||||
"id": "10d12798-08fb-4aa6-977b-5dd94d82dbfe"
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"userName": "admin",
|
||||
"firstName": "Administrator",
|
||||
"lastName": "",
|
||||
"email": "admin@gmail.com",
|
||||
"salt": "55f8fafcf829479ca97e635937440fee",
|
||||
"password": "3b459ae9988628d41f0362c499a768dd",
|
||||
"role": "admin",
|
||||
"updatedTime": "2023-08-14T18:14:03.4602072Z",
|
||||
"createdTime": "2023-08-14T18:14:03.4602075Z",
|
||||
"id": "456e35c5-caf0-4d45-9084-b44a8ca717e4",
|
||||
"externalId":""
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"userName": "nancy",
|
||||
"firstName": "Nancy",
|
||||
"lastName": "Luna",
|
||||
"email": "user1@gmail.com",
|
||||
"salt": "55f8fafcf829479ca97e635937440fee",
|
||||
"password": "3b459ae9988628d41f0362c499a768dd",
|
||||
"role": "client",
|
||||
"updatedTime": "2023-11-13T18:00:00Z",
|
||||
"createdTime": "2023-11-13T18:00:00Z",
|
||||
"id": "d0e6680d-03d5-4ed8-bdcd-aa7d86f2a1bc"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"userName": "elon",
|
||||
"firstName": "Elon",
|
||||
"lastName": "Musk",
|
||||
"email": "csr1@gmail.com",
|
||||
"salt": "55f8fafcf829479ca97e635937440fee",
|
||||
"password": "3b459ae9988628d41f0362c499a768dd",
|
||||
"role": "csr",
|
||||
"updatedTime": "2023-11-13T18:00:00Z",
|
||||
"createdTime": "2023-11-13T18:00:00Z",
|
||||
"id": "e465af5f-044f-414b-b670-92834929b96c"
|
||||
}
|
||||
31
dockerfiles/docker-compose.infrastructure.override.yml
Normal file
31
dockerfiles/docker-compose.infrastructure.override.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
mongodb:
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: ${ENV_MONGO_INITDB_ROOT_USERNAME}
|
||||
MONGO_INITDB_ROOT_PASSWORD: ${ENV_MONGO_INITDB_ROOT_PASSWORD}
|
||||
ports:
|
||||
- 27017:27017
|
||||
|
||||
keycloak.localhost:
|
||||
environment:
|
||||
- KEYCLOAK_ADMIN=admin
|
||||
- KEYCLOAK_ADMIN_PASSWORD=admin
|
||||
- KC_DB=postgres
|
||||
- KC_DB_URL_HOST=postgresql.localhost
|
||||
- KC_DB_URL_DATABASE=keycloak
|
||||
- KC_DB_PASSWORD=123456
|
||||
- KC_DB_USERNAME=keycloak
|
||||
- KC_DB_SCHEMA=public
|
||||
ports:
|
||||
- 8080:8080
|
||||
|
||||
postgresql.localhost:
|
||||
environment:
|
||||
# ALLOW_EMPTY_PASSWORD is recommended only for development.
|
||||
- POSTGRES_PASSWORD=123456
|
||||
- POSTGRESQL_USERNAME=keycloak
|
||||
- POSTGRESQL_DATABASE=keycloak
|
||||
ports:
|
||||
- 5432:5432
|
||||
37
dockerfiles/docker-compose.infrastructure.yml
Normal file
37
dockerfiles/docker-compose.infrastructure.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo:7.0-jammy
|
||||
container_name: botsharp_mongo
|
||||
volumes:
|
||||
- mongo7_data_7.0-jammy:/data/db
|
||||
networks:
|
||||
- botsharp-network
|
||||
|
||||
keycloak.localhost:
|
||||
image: quay.io/keycloak/keycloak:22.0.3
|
||||
command: start-dev
|
||||
container_name: keycloak.localhost
|
||||
depends_on:
|
||||
- postgresql.localhost
|
||||
networks:
|
||||
- botsharp-network
|
||||
|
||||
|
||||
postgresql.localhost:
|
||||
image: docker.io/bitnami/postgresql:16
|
||||
container_name: postgresql.localhost
|
||||
volumes:
|
||||
- postgres_data_16:/var/lib/postgresql/data
|
||||
networks:
|
||||
- botsharp-network
|
||||
|
||||
|
||||
volumes:
|
||||
mongo7_data_7.0-jammy:
|
||||
postgres_data_16:
|
||||
|
||||
networks:
|
||||
botsharp-network:
|
||||
external: true
|
||||
|
|
@ -7,11 +7,11 @@ services:
|
|||
context: ../
|
||||
dockerfile: dockerfiles/WebStarter.Dockerfile
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 5500:5500
|
||||
env_file:
|
||||
- ./.env
|
||||
volumes:
|
||||
- ./appsettings.json:/app/appsettings.json
|
||||
networks: ['botsharp-network']
|
||||
|
||||
networks: {botsharp-network: {}}
|
||||
- ./data:/app/data
|
||||
networks:
|
||||
- botsharp-network
|
||||
|
|
|
|||
2
dockerfiles/run-docker-compose.ps1
Normal file
2
dockerfiles/run-docker-compose.ps1
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
docker network create botsharp-network
|
||||
docker-compose -f docker-compose.yml -f docker-compose.infrastructure.yml -f docker-compose.infrastructure.override.yml up -d
|
||||
2
dockerfiles/stop-docker-compose.ps1
Normal file
2
dockerfiles/stop-docker-compose.ps1
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
docker-compose -f docker-compose.yml -f docker-compose.infrastructure.yml -f docker-compose.infrastructure.override.yml down
|
||||
docker network rm botsharp-network
|
||||
|
|
@ -20,14 +20,16 @@ Log.Logger = new LoggerConfiguration()
|
|||
.CreateLogger();
|
||||
builder.Host.UseSerilog();
|
||||
|
||||
// Add BotSharp
|
||||
builder.Services.AddBotSharpCore(builder.Configuration)
|
||||
.AddBotSharpOpenAPI(builder.Configuration, new[]
|
||||
string[] allowedOrigins = builder.Configuration.GetSection("AllowedOrigins").Get<string[]>() ?? new[]
|
||||
{
|
||||
"http://0.0.0.0:5015",
|
||||
"https://botsharp.scisharpstack.org",
|
||||
"https://chat.scisharpstack.org"
|
||||
}, builder.Environment, true)
|
||||
};
|
||||
|
||||
// Add BotSharp
|
||||
builder.Services.AddBotSharpCore(builder.Configuration)
|
||||
.AddBotSharpOpenAPI(builder.Configuration, allowedOrigins, builder.Environment, true)
|
||||
.AddBotSharpLogger(builder.Configuration);
|
||||
|
||||
// Add SignalR for WebSocket
|
||||
|
|
|
|||
|
|
@ -6,7 +6,12 @@
|
|||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
"AllowedOrigins": [
|
||||
"http://localhost:5015",
|
||||
"http://0.0.0.0:5015",
|
||||
"https://botsharp.scisharpstack.org",
|
||||
"https://chat.scisharpstack.org"
|
||||
],
|
||||
"Jwt": {
|
||||
"Issuer": "botsharp",
|
||||
"Audience": "botsharp",
|
||||
|
|
@ -38,15 +43,15 @@
|
|||
{
|
||||
"Name": "gpt-35-turbo",
|
||||
"ApiKey": "",
|
||||
"Endpoint": "https://ai4c-demo.openai.azure.com/",
|
||||
"Endpoint": "https://gpt-35-turbo.openai.azure.com/",
|
||||
"Type": "chat",
|
||||
"PromptCost": 0.0015,
|
||||
"CompletionCost": 0.002
|
||||
},
|
||||
{
|
||||
"Name": "gpt-35-turbo",
|
||||
"Name": "gpt-35-turbo-instruct",
|
||||
"ApiKey": "",
|
||||
"Endpoint": "https://ai4c-demo.openai.azure.com/",
|
||||
"Endpoint": "https://gpt-35-turbo-instruct.openai.azure.com/",
|
||||
"Type": "text",
|
||||
"PromptCost": 0.0015,
|
||||
"CompletionCost": 0.002
|
||||
|
|
@ -100,7 +105,7 @@
|
|||
"EnableLlmCompletionLog": false,
|
||||
"EnableExecutionLog": true,
|
||||
"EnableContentLog": true,
|
||||
"EnableStateLog": true
|
||||
"EnableStateLog": true
|
||||
},
|
||||
|
||||
"Statistics": {
|
||||
|
|
@ -156,9 +161,9 @@
|
|||
},
|
||||
|
||||
"Database": {
|
||||
"Default": "FileRepository",
|
||||
"Default": "MongoRepository",
|
||||
"TablePrefix": "BotSharp",
|
||||
"BotSharpMongoDb": "",
|
||||
"BotSharpMongoDb": "mongodb://root:admin@localhost:27017/botsharp?authSource=admin",
|
||||
"FileRepository": "data",
|
||||
"Assemblies": [ "BotSharp.Core" ]
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue