Custom chat interface DEMO using two LLM's - Ollama Mistral and open AI GPT4

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 05:13
Joined
Jul 9, 2003
Messages
17,448
In my exploration of the possibility of moving the Northwind database onto the web I have been studying the tables and I saw the "Strings" table.... I'm of the opinion that having the strings stored in a table detracts from the readability of the code and could lead to errors .... so I decided to load it up into "UberChatMaster" my custom interface for communicating with various large language models --- I've got it set up to use both a local Ollama Mistral and the online open AI Chat GPT4 .....

I presented my reservations to the local large language model which resides on my personal hard drive "Ollama Mistral" ---

[USER] 31/05/2025, 22:23:48
in the latest northwind database the developer edition there is a strings table:-

SELECT Strings.StringID, Strings.StringData, Strings.AddedBy, Strings.AddedOn, Strings.ModifiedBy, Strings.ModifiedOn
FROM Strings;

the most relevant field is the string data field and this is its content:-

StringData
Hello {0}. This is {1}.
Please enter a number between {0} and {1}.
Only orders with status of Paid can be closed.
OK to close this order?
An order can only be deleted before it is Shipped or Closed.
Are you sure you want to permanently delete this {0}?
Record cannot be saved because not all required fields have been filled out. They are highlighted for your review.
The order cannot be shipped until all Shipping related fields are filled out.
Only orders with status of Invoiced can be shipped.
There is no data for this report. Please try different criteria.
{0} is not in the list of employees. If you want to add {0} as a supervisor, you must first add them as an employee.
"{0} {1}

{2}.

"
Confirm deletion of {0}.
"{0} is not a valid US phone number. Phone numbers must be formatted as either ""(222) 333-444"" or ""555-6666"""
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, places, or events is intended or should be inferred.
The order cannot be invoiced until all line items have a status of Allocated. Allocation happens automatically when a PO is received with sufficient quantity.
You are already on a new record.
You don't have the {0} privilege so you cannot perform this action. If you feel this is an error, discuss it with your supervisor. (TIP: login as Andrew Cencini, or give yourself rights in System Admin > Privileges)
The purchase order can only be submitted if it is in the New status.
The purchase order can only be approved if it is in the Submitted status.
Changing vendor will remove all purchase line items. OK to continue?
Has the entire purchase order been received, and are you ready to post to inventory? Orders waiting for these products will be updated.
The purchase order can only be received if it is in the Approved status.
The purchase order can only be closed if it is in the Received status.
Shipping Fee and Payment Method are required before closing the purchase order.
A purchase order can only be deleted when its Status is New or Submitted.
This quantity is less than the Minimum Re-Order Quantity of {0}. That is not allowed.
This quantity will result in an inventory level less than the Target Level of {0}. That is allowed but undesirable. Consider ordering at least {1} more.
The new status has been set.
Was the order paid today?
{0} '{1}' cannot be deleted because it has a related {2} record.
An order must have at least one line item.
You cannot change the Company Type if the Company has Orders/Purchase Orders.
The order cannot be paid until all Payment related fields are filled out.
You can't {0} if the Company has
Customer Orders ({1})
Shipper Orders ({2})
Vendor Purchase Orders ({3})
{4}

If you delete the Company any
Contacts ({0})
and/or Vendor Products ({1}) will be deleted.

Is this OK?
This option is not available on a new order.
If there are no recent orders, you may want to use Recent Dates on the System Admin form to move the dates of existing records forward.
"This Northwind Dev Edition template is brought to you by the ""Northwind Working Group"", a community team of volunteers who spent a year designing, implementing, documenting, and testing this application, and its companion Northwind Starter Edition.

The core working group members are Dawn Taylor, George Hepworth, George Young, Kim Young, and Tom van Stiphout. Michael Aldridge led the effort at Microsoft.

Many people contributed to the success of this project, including focus group members, alpha testers, former and current Access MVPs, videographers, help text editors, accessibility testers, intellectual property lawyers, and many others. It really takes a whole community.

Please share your feedback with the team. We will be watching the Access Tech Community forum, as well as other forums where Access developers hang out."
The form {0} is already open. Please close the form before opening a new {0}.
Tour the Gastronomic World with Northwind Traders!
"When Northwind Traders buyers set out to search for the Wonders of the Gastronomic World they found a lot more than seven of them. And here they are--tastefully presented in our Fall Catalog.

The beverages and confections we're featuring this fall are sure to please even the most discerning palates.

For thirst quenchers, try exotic chai, a hearty beer, or revitalizing coffee.

And for a taste of something sweet, try our brownie and cake mixes, or our rich, dark chocolate.

Our sales representatives are ready to take your orders now. For your convenience, we've included details on ordering on the last page of this catalog."
Commitment to Quality
Northwind Traders is committed to bringing you products of the highest quality from all over the world. If at any time you are not completely satisfied with any of our products, you may return them to us for a full refund.
"How to order:
To place your order, fill out this order form and return it to us. For fast personal service,
call us at 1-206-555-1417. If you prefer to order by fax, prepare your order as you would
for a mail-in, and then fax us at 1-206-555-5938."
You have changed the data and not saved it. Do you want to save it now? Selecting No will undo your changes.
Only orders with status of Shipped can be paid.
Only orders with status of New can be invoiced.
Please first complete the Order at the top of this form, before entering Order Line Items.

I think this is done so that the text is stored in a central place and then remains in volatile or easily modified in one place --- I think I may have said contrarydictatory things!!

I would imagine there are for and against for this approach I am against it myself because I think you lose the self documenting nature of code by removing the text somewhere else ... I assume the fors and against our often debated on the internet and I wondered if we could have a chat about it

[MISTRAL] 31/05/2025, 22:24:08
The approach you described, where static text is stored in a separate table like the Strings table, has its advantages and disadvantages. Here are some points for both perspectives:

**For this approach:**
1. Centralized storage of text makes it easier to maintain and update text across the application, as changes only need to be made in one place. This can be particularly useful when dealing with multi-language support.
2. It allows for a more modular design, where changes to the user interface do not require modifying the code itself. This can help keep code cleaner and easier to read.
3. It can make it simpler to translate the application into different languages since all the text is stored in one place.

**Against this approach:**
1. Removing text from the code makes it less self-documenting, as developers need to look in multiple places (code and strings table) to understand what's happening. This can lead to confusion and potential errors.
2. It may create an additional maintenance burden when trying to keep the Strings table up-to-date with changes in the code or user interface.
3. It could potentially lead to outdated text being displayed if the code and strings table are not properly synchronized.

As for whether this is often debated on the internet, it indeed is! Many developers have strong opinions about this topic, as both approaches have their merits and challenges. In general, the choice between keeping text in the code or a separate storage depends on factors such as the size and complexity of the application, team preferences, and project requirements.

It's always good to consider the trade-offs and choose the approach that best suits your specific needs. In any case, having open discussions about these topics can help lead to more informed decisions and better design choices in software development.

[USER] 31/05/2025, 22:26:22
have there been any particular discussions regarding its use in the Microsoft Access sample database the northwind developer edition

[MISTRAL] 31/05/2025, 22:26:30
It appears that the Northwind Developer Edition sample database by Microsoft does not provide much insight into specific discussions or debates about using a separate Strings table to store UI text. However, since it is an example database and not a fully-fledged product, its design choices are meant more for demonstrating various features of Microsoft Access rather than representing best practices in all aspects.

That being said, you can find many discussions on the internet about storing UI text in separate tables versus keeping it directly in the code. These discussions often take place on developer forums, blogs, and Stack Overflow, among other platforms. You may want to check out resources like these to learn more about the pros and cons of each approach and see what others have said about its use in Microsoft Access specifically.
 
Last edited:
The beauty of the "UberChatMaster" interface is that I can switch between models in the same chat, I switched from Ollama Mistral to open AI - chat GPT

>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>

Switched to [GPT-4O]

[USER] 31/05/2025, 22:28:11

I have discussed aspects of using a strings table in a database in this thread with Ollama Mistral - I wondered if you wanted to make a comment ChatGPT

[GPT-4O] 31/05/2025, 22:28:18

Certainly! Here are some additional considerations and reflections on using a strings table in a database like the Northwind example:

1. **Scalability and Localization**: If the application is likely to be expanded internationally, having strings centralized makes handling multiple languages much simpler and more efficient. It allows for easy adjustments or additions of languages without code changes.

2. **Consistency**: A centralized strings table ensures consistent messaging across different parts of the application. If a message needs to be updated, it can be changed in one place rather than several, minimizing the risk of inconsistencies.

3. **Separation of Concerns**: By storing text separately, you allow developers and content creators (such as translators or technical writers) to work independently, which can streamline workflows.

4. **Database Overhead**: Every time a message is needed, there might be a slight overhead due to the necessity of database queries to retrieve the string. This might not be significant for most applications, but it's a factor to consider, especially if you have a high-load application.

5. **Development Tooling**: When using a strings table, tools, and documentation should be in place to help developers easily find, edit, and understand how these strings relate to the application logic. If this infrastructure is missing, using a strings table can complicate development rather than simplify it.

For many, the decision to use a strings table ties closely with the anticipated scale and complexity of the application. If you plan for extensive user interface text or enter a multi-language market, this architecture might be beneficial. For smaller, simpler applications, the overhead might not be justified.

Ultimately, the choice should reflect the needs and scale of the project while considering the team's development practices and existing tooling. If you have ongoing discussions with others like Ollama Mistral, these points might add to your conversation or introduce new aspects to consider.

[USER] 31/05/2025, 22:37:27
to make it work effectively with multiple languages the table would need a slight REdesign - I would suggest adding an extra field to identify the language of the string so for example you can have one for English two for Spanish so the query to return the string would also check on the language selected by the user in a combo box in some setup area.

this is an SQL statement which describes the current table

SELECT Strings.StringID, Strings.StringData, Strings.AddedBy, Strings.AddedOn, Strings.ModifiedBy, Strings.ModifiedOn
FROM Strings;

I would guess that the Strings.StringID is currently an auto number indexed to be unique -- this would have to be changed to allow for the different languages...

SELECT Strings.StringID, Strings.StringLanguage, Strings.StringData, Strings.AddedBy, Strings.AddedOn, Strings.ModifiedBy, Strings.ModifiedOn
FROM Strings;

Switched to [MISTRAL]

what do you think> have I missed anything ?

[MISTRAL] 31/05/2025, 22:37:44
You've made a good point about the need to identify the language for each string when dealing with multiple languages in the Northwind example database. Your proposed solution of adding a `Strings.StringLanguage` field and adjusting the query to filter by this new field is a sound approach.

In addition, you should also consider the following points:

1. **Data Normalization**: To ensure data consistency, you may want to create a separate table for language codes or use an industry standard such as ISO 639-1 or 639-2 (e.g., en for English, es for Spanish) for the `Strings.StringLanguage` field.

2. **Default Language**: It's essential to have a default language that will be used when no specific language is selected by the user. This could be represented as a default value in the `Strings.StringLanguage` field or another field in a user setup table.

3. **Handling missing translations**: In case some strings don't have translations for certain languages, it's crucial to have a fallback mechanism, such as displaying the English version of the string when no translation is available for the selected language.

4. **Maintainability**: Consider implementing a process or tools that help content creators easily manage and update translations in the strings table. This might include automated translation services, version control systems, or even manual workflows.

5. **Performance**: Keep in mind that querying the database for strings based on the selected language could add some overhead, especially when dealing with large amounts of data. Optimizing queries and caching translated results can help improve performance.

By addressing these considerations, you'll be able to make your Northwind example database more robust and versatile for handling multiple languages efficiently.

Switched to [GPT-4O]

[USER] 31/05/2025, 22:39:04

do you have any observations to add chatty

[GPT-4O] 31/05/2025, 22:39:11
Certainly! Here are some more observations and considerations you may want to think about while implementing a multilingual strings table in a database like Northwind:

1. **Primary Key Composition**: If `StringID` is currently an auto-number, you could consider making `StringID` and `StringLanguage` together a composite key. This ensures each combination of string and language is unique. Alternatively, you could retain the auto-increment `StringID` and instead have a separate `StringKey` with a logical identifier for the string, allowing `StringID` to remain unique.

2. **User Settings**: Ensure that there’s a user settings table or mechanism to store each user's language preferences. This could enhance the user experience by automatically loading the correct language for them.

3. **StringKey Proposal**: Introduce a `StringKey` field to act as a logical identifier for each message. It can make querying and managing strings easier, allowing `StringID` to serve as a unique database identifier, while `StringKey` identifies the core message independent of language.

4. **Translation Management System Integration**: Consider using a translation management system (TMS) if you anticipate frequent content updates. A TMS can help streamline the localization process, manage translations efficiently, and integrate into your existing database.

5. **Testing and QA**: Implement thorough testing to ensure translations are correct and contextually appropriate. It can be helpful to have a native speaker or localization specialist verify translations for cultural nuances and formal correctness.

6. **Complexity of Formatting**: For sentences requiring dynamic data insertion (like `{0}`), ensure that translators are aware of the placeholder usage. Maintaining a guide on how and when to use placeholders can help avoid formatting errors in translations.

These added considerations can enhance the robustness of your multilingual support and ensure a seamless experience for users in different languages. Plus, by planning for future scalability and ease of management, you make the application more adaptable as needs evolve.
 

Users who are viewing this thread

Back
Top Bottom