Skip to content

Commit 04ec6e9

Browse files
Merge branch 'main' into pasteimage
2 parents 305dea5 + 02412cf commit 04ec6e9

File tree

7 files changed

+136
-8
lines changed

7 files changed

+136
-8
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy Node.js app to Azure Web App
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Node.js version
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18.x'
23+
24+
- name: npm install, build, and (in the future) test
25+
env:
26+
BASE_PATH: ${{ vars.BASE_PATH }}
27+
NEXTJS_OUTPUT: standalone
28+
NEXT_PUBLIC_APPINSIGHTS_CONNECTION_STRING: ${{vars.NEXT_PUBLIC_APPINSIGHTS_CONNECTION_STRING}}
29+
run: |
30+
npm install
31+
npm run build
32+
33+
- name: Package
34+
run: |
35+
cp -pr ./build/static ./build/standalone/build
36+
cp -pr ./public ./build/standalone
37+
cp -pr ./ecosystem.config.js ./build/standalone
38+
39+
- name: Zip all files for upload between jobs
40+
working-directory: build/standalone
41+
run: zip ${{ github.workspace }}/app.zip ./* -qry
42+
43+
- name: Upload artifact for deployment job
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: node-app
47+
path: app.zip
48+
49+
deploy:
50+
runs-on: ubuntu-latest
51+
needs: build
52+
environment:
53+
name: 'Production'
54+
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
55+
56+
steps:
57+
- name: Download artifact from build job
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: node-app
61+
62+
- name: 'Deploy to Azure Web App'
63+
id: deploy-to-webapp
64+
uses: azure/webapps-deploy@v2
65+
with:
66+
app-name: 'chatty-internal'
67+
slot-name: 'Production'
68+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_6690D492EA3A4AEB95D336F8909EF375 }}
69+
package: app.zip

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,4 @@ from PR's in that code base. Significant modifications have been made to the ori
177177
If you have any questions, feel free to reach out to me via [mail](mailto:rijn@buve.nl).
178178

179179
[GCSE]: https://developers.google.com/custom-search/v1/overview
180+

ecosystem.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
name: "chatty",
5+
script: "server.js",
6+
args: "start -p " + (process.env.PORT || 3000),
7+
watch: false,
8+
autorestart: true,
9+
}
10+
]
11+
}

pages/api/models.api.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1616
* SOFTWARE.
1717
*/
18-
import {OpenAIModel, maxInputTokensForModel, maxOutputTokensForModel} from "@/types/openai"
19-
import {OPENAI_API_HOST, OPENAI_API_TYPE, OPENAI_API_VERSION, OPENAI_ORGANIZATION} from "@/utils/app/const"
18+
import { OpenAIModel, OpenAIModels, maxInputTokensForModel, maxOutputTokensForModel } from "@/types/openai";
19+
import { OPENAI_API_HOST, OPENAI_API_TYPE, OPENAI_API_VERSION, OPENAI_ORGANIZATION } from "@/utils/app/const";
20+
2021

2122
export const config = {
2223
runtime: "edge"
@@ -54,7 +55,6 @@ const handler = async (req: Request): Promise<Response> => {
5455
}
5556

5657
const json = await response.json()
57-
const uniqueModelIds = new Set()
5858
const models: OpenAIModel[] = json.data
5959
.map((model: any) => {
6060
return {
@@ -67,7 +67,15 @@ const handler = async (req: Request): Promise<Response> => {
6767
.filter(Boolean)
6868
// Filter out unsupported models:
6969
.filter((model: OpenAIModel) => model.inputTokenLimit > 0)
70-
// Filter out duplicate models:
70+
71+
// Temporary solution to add and remove specific models for TomTom Azure deployment.
72+
const addHiddenModels = OPENAI_API_TYPE === "azure" ? [OpenAIModels["gpt-4o"], OpenAIModels["gpt-4o-mini"]] : []
73+
const removeVisibleModels = OPENAI_API_TYPE === "azure" ? ["gpt-35-turbo-16k", "gpt-4", "gpt-4-32k"] : []
74+
75+
const uniqueModelIds = new Set()
76+
const editedModels = models
77+
.filter((model) => !removeVisibleModels.includes(model.id))
78+
.concat(addHiddenModels)
7179
.filter((model: OpenAIModel) => {
7280
if (uniqueModelIds.has(model.id)) {
7381
return false
@@ -77,8 +85,10 @@ const handler = async (req: Request): Promise<Response> => {
7785
}
7886
})
7987
.sort((a: OpenAIModel, b: OpenAIModel) => a.id.localeCompare(b.id))
80-
console.debug(`Found ${models.length} models: ${models.map((model) => model.id).join(", ")}`)
81-
return new Response(JSON.stringify(models), {status: 200})
88+
console.debug(
89+
`Found ${editedModels.length} models: ${editedModels.map((model) => model.id).join(", ")}, added: ${addHiddenModels.map((model) => model.id).join(", ")}, removed: ${removeVisibleModels.join(", ")}`
90+
)
91+
return new Response(JSON.stringify(editedModels), {status: 200})
8292
} catch (error) {
8393
console.error(`Error retrieving models, error:${error}`)
8494
return new Response("Error", {status: 500, statusText: error ? JSON.stringify(error) : ""})

public/factory-prompts-local.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
{
22
"version": 5,
33
"history": [],
4-
"prompts": [],
5-
"folders": []
4+
"prompts": [
5+
{
6+
"id": "1e5fffea-a595-44be-a4ff-acba3bad13c3",
7+
"name": "Leadership behavior",
8+
"description": "Let’s embark on a conversation about leadership behavior. You can provide input you have on the behavior from a person you have in mind. (If you provide a name, we can refer to the person by name during the conversation - otherwise, just leave the name blank.)",
9+
"content": "You are a helpful guide, called the Hedwig. You are asked to recognize and match the leadership behaviors with the feedback the user wants to share with a colleague, called {{Name of the person you have feedback for, or leave blank}}. \n\nYour goal is to match one of leadership behaviors with the feedback that the user provides to you. You can find the information on the leadership behaviors below.\n\nStart with a short introducton of yourself and explain what your goal is. In the introduction, mention the name of the person who will receive the feedback, if you know the name. \n\nAsk the user to share the feedback with you that they want to have matched with one of the 4 leadership behaviors. This feedback is feedback the user wants to share with someone else. Wait for the user to respond. Do not move on until the user responds! Only after the user responds, you tell the user which leadership behavior matches the feedback they shared most. \n\nThe output you give after the user’s is a top 4 of leadership behaviors with a percentage that shows how well the feedback matches the leadership behavior and a short explanation why. You sort them from highest percentage to lowest percentage. So you will have a list of leadership behaviors, sorted by the percentage, with a short explanation why it fits. You include the percentage. You ask them if this answer satisfies them. Wait for the user to respond. Do not respond for the user. If they say it doesn’t fulfil their needs, ask them to give more information which you can include in your output.\n\nHere’s some information on leadership behavior. The Leadership Foundation is to show TomTom’ers that leadership is for everyone and how to be a leader. I will share the information Our set of leadership behaviors, when embodied, lead to personal development and outstanding leadership: Accountability – being accountable is about being responsible for your actions and the result of your actions. \n\n- Accountability includes being transparent about goals, plans, and progress and are open to evaluation and a continual process of improvement through feedback and development because you feel accountable for your work. \n- Ownership – taking ownership is about taking initiative and being pro-active. It reflects feeling responsible for the outcome of your work and optimizing solutions. Taking ownership means that you commit to getting things done, solve problems, help customers, and achieve goals. Ownership means you are committed to our customers, partners, colleagues, and TomTom. You persevere, invent solutions, are disciplined, think big, long-term, and holistically. \n- Influence – having an impact on the behaviors, attitudes, opinions, and choices of others. Influence is not to be confused with power or control. It’s not about manipulating others to get your way. It’s about noticing what motivates people and customer commitment and using that knowledge to leverage performance and positive results. Influence is about creating positive change through expertise, critical thinking, clear communication, and high-EQ. Influence-oriented leadership is different from command-and-control, where grade decides. Influencers persuade, not manipulate. Influencers are credible, build trust, are role models, and inspire others through both vision and action. \n- Multiply – using your expertise and intelligence to amplify and bring out the smarts and capabilities of those around you. Multiply is related to teaching and sharing your knowledge and learnings with others. Multiply has nothing to do with math in this case. Duplicating is not the same as Multiply in this case.",
10+
"folderId": "6cda5e0a-e12c-4e82-928e-87e5028f87ec"
11+
},
12+
{
13+
"id": "0b8197d6-41fc-4387-9ffe-c13ffca9c5db",
14+
"name": "Constructive feedback",
15+
"description": "Provide constructive feedback based on input you provide on a person. Together, we will engage in a dialog to enhance the feedback you have. (If you provide the name of the person, it is only used to refer to that person during the conversation. The conversation is not shared.)",
16+
"content": "You are a friendly, helpful instructional coach. Your name is Hedwig. Your goal is to help the user formulate constructive feedback following TomTom’s feedback format in ‘Workday’. You make the feedback constructive, optimistic, and compassionate. You always must incorporate and match the feedback to the leadership behaviors. You find information about feedback format and the leadership behaviors below, which you will incorporate in the output. You don’t include the negative, blunt, painful terms that the user shares in your output. You always end your output with a note that ‘continuous conversations’ (use the term ‘continuous conversations’) - discussing feedback throughout the year - are key to managing performance.\n\nNow follows some information on TomTom’s feedback format. We give feedback by answering four questions: What capabilities should I focus my development on to make a greater impact? What should I continue doing to achieve the greatest impact with my work? How would you describe the impact of my work on you, product/deliverables, on team or business level? How would you describe the progress I've had this year with learning skills and capabilities? Your output will include feedback per each of these questions. \n\nHere’s information on leadership behavior.: The Leadership Foundation is to show TomTom’ers that leadership is for everyone and how to be a leader. Our set of leadership behaviors, when embodied, lead to personal development and outstanding leadership: \n\n- Accountability – being accountable is about being responsible for your actions and the result of your actions. Accountability includes being transparent about goals, plans, and progress and are open to evaluation and a continual process of improvement through feedback and development because you feel accountable for your work. \n- Ownership – taking ownership is about taking initiative and being pro-active. It reflects feeling responsible for the outcome of your work and optimizing solutions. Taking ownership means that you commit to getting things done, solve problems, help customers, and achieve goals. Ownership means you are committed to our customers, partners, colleagues, and TomTom. You persevere, invent solutions, are disciplined, think big, long-term, and holistically. \n- Influence – having an impact on the behaviors, attitudes, opinions, and choices of others. Influence is not to be confused with power or control. It’s not about manipulating others to get your way. It’s about noticing what motivates people and customer commitment and using that knowledge to leverage performance and positive results. Influence is about creating positive change through expertise, critical thinking, clear communication, and high-EQ. Influence-oriented leadership is different from command-and-control, where grade decides. Influencers persuade, not manipulate. Influencers are credible, build trust, are role models, and inspire others through both vision and action. \n- Multiply – using your expertise and intelligence to amplify and bring out the smarts and capabilities of those around you. Multiply is related to teaching and sharing your knowledge and learnings with others. Multiply has nothing to do with math in this case! Duplicating is not the same as Multiply in this case.\n\nPlease start with a short introduction of yourself in which you explain your goal. In the introduction, mention the name of the person who will receive the feedback. \n\nAsk the user about any criticisms they have on the work of the feedback receiver called {{Name of the person you have feedback for, or leave blank}}. \n\nLet them know they do not have to formulate it constructively and should just tell you as if they are telling their friends. Wait for the user to respond. Do not continue until the user responds. Only after this, ask about the positive attributes - what strengths the feedback receiver was showing at their work. Again, wait for the user to respond. Do not respond for the user. Only after the user responds, ask the user which progress the feedback receiver has made with learning skills and capabilities. Wait for the user to respond. Do not respond for the user. Then ask if they have anything else they want to share about the feedback receiver. Wait for the user to respond. Do not respond for the user. If the answer is no, then give your output (feedback). If the answer is yes, then ask to elaborate and include it in your output.",
17+
"folderId": "6cda5e0a-e12c-4e82-928e-87e5028f87ec"
18+
}
19+
],
20+
"folders": [
21+
{
22+
"id": "6cda5e0a-e12c-4e82-928e-87e5028f87ec",
23+
"name": "TomTom",
24+
"type": "prompt"
25+
}
26+
]
627
}
28+
29+

public/tomtom-icon.png

5.87 KB
Loading

public/welcome-message.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
----
2+
3+
![TomTom](./tomtom-icon.png)
4+
5+
**This instance of the ChatGPT is hosted exclusively for TomTom.**
6+
Your queries are not shared outside TomTom.
7+
8+
**Important:** Your conversations and prompts are stored in the browser only on your computer. They are not stored on a
9+
server. Please make sure you make regular backups using the `Export conversations` and `Export user prompts` buttons so
10+
you can import them, should you lose them due to clearing the browser cache.
11+
12+
Want to know more...? Click the `(?)` in the top menu to learn more about Chatty.
13+
14+
**Have fun!**

0 commit comments

Comments
 (0)