You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.**Use normalized model IDs** - Don't include provider prefixes in the model ID itself
67
+
2.**Add provider mapping** - Map the normalized IDs to your provider's specific format internally
68
+
3.**Preserve capabilities** - Ensure models accessed through your provider report the same capabilities as their native counterparts
69
+
4.**Update models.json** - Include your provider's models in models.json
70
+
5.**Update aliases.json** - Add entries to aliases.json for models accessible through your provider
71
+
6.**Implement refresh mechanism** - Ensure your provider supports the `list_models` method for refreshing
72
+
73
+
### Model Aliases
74
+
75
+
For providers that use complex model identifiers (like Bedrock's `anthropic.claude-3-5-sonnet-20241022-v2:0:200k`), add mappings to the global aliases.json file:
If a model can't be found with the provided ID and provider, a `ModelNotFoundError` will be raised with an informative message. Your implementation should make this error helpful by suggesting available alternatives.
93
+
94
+
When the same model has multiple versions and context windows e.g.
95
+
96
+
```
97
+
anthropic.claude-3-5-sonnet-20240620-v1:0
98
+
anthropic.claude-3-5-sonnet-20240620-v1:0:18k
99
+
anthropic.claude-3-5-sonnet-20240620-v1:0:200k
100
+
anthropic.claude-3-5-sonnet-20240620-v1:0:51k
101
+
anthropic.claude-3-5-sonnet-20241022-v2:0
102
+
anthropic.claude-3-5-sonnet-20241022-v2:0:18k
103
+
anthropic.claude-3-5-sonnet-20241022-v2:0:200k
104
+
anthropic.claude-3-5-sonnet-20241022-v2:0:51k
105
+
```
106
+
107
+
We default all aliases to the biggest context window, and the main alias (without date) to the latest version:
See [Working with Models]({% link guides/models.md %}) for more details on model selection.
46
73
## System Prompts
47
74
48
75
System prompts allow you to set specific instructions or context that guide the AI's behavior throughout the conversation. These prompts are not directly visible to the user but help shape the AI's responses:
@@ -67,6 +94,8 @@ chat.add_message role: :system, content: "Always format your code using proper R
67
94
# - Creating specialized assistants
68
95
```
69
96
97
+
If you want to set up system prompts with persistence, please refer to the [Rails integration guide]({% link guides/rails.md %}#using-system-messages)
98
+
70
99
## Multi-turn Conversations
71
100
72
101
Chats maintain conversation history automatically:
@@ -275,4 +304,4 @@ Now that you understand chat basics, you might want to explore:
275
304
276
305
-[Using Tools]({% link guides/tools.md %}) to let AI use your Ruby code
277
306
-[Streaming Responses]({% link guides/streaming.md %}) for real-time interactions
278
-
-[Rails Integration]({% link guides/rails.md %}) to persist conversations in your apps
307
+
-[Rails Integration]({% link guides/rails.md %}) to persist conversations in your apps
0 commit comments