Skip to content

Commit 7e804dd

Browse files
committed
feat: update origin 20.2.0
Update origin submodule and English source files for version 20.2.0 🤖 Generated with [Claude Code](https://claude.ai/code)
1 parent ead279a commit 7e804dd

File tree

4 files changed

+7
-56
lines changed

4 files changed

+7
-56
lines changed

adev-ja/src/app/sub-navigation-data.en.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,11 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [
685685
path: 'ai/develop-with-ai',
686686
contentPath: 'ai/develop-with-ai',
687687
},
688+
{
689+
label: 'Design Patterns',
690+
path: 'ai/design-patterns',
691+
contentPath: 'ai/design-patterns',
692+
},
688693
{
689694
label: 'Angular CLI MCP Server setup',
690695
path: 'ai/mcp',

adev-ja/src/content/ai/mcp-server-setup.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ The Angular CLI MCP server provides several tools to assist you in your developm
136136

137137
## Feedback and New Ideas
138138

139-
The Angular team welcomes your feedback on the existing MCP capabilities and any ideas you have for new tools or features. Please share your thoughts by opening an issue on the [angular/angular GitHub repository](https://github.com/angular/angular/issues).
139+
The Angular team welcomes your feedback on the existing MCP capabilities and any ideas you have for new tools or features. Please share your thoughts by opening an issue on the [angular/angular GitHub repository](https://github.com/angular/angular/issues).

adev-ja/src/content/ai/overview.en.md

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -60,60 +60,6 @@ The [Gemini API](https://ai.google.dev/gemini-api/docs) provides access to state
6060

6161
* [AI Chatbot app template](https://github.com/FirebaseExtended/firebase-framework-tools/tree/main/starters/angular/ai-chatbot) - This template starts with a chatbot user interface that communicates with the Gemini API via HTTP.
6262

63-
## AI patterns in action: Streaming chat responses
64-
Having text appear as the response is received from the model is a common UI pattern for web apps using AI. You can achieve this asynchronous task with Angular's `resource` API. The `stream` property of `resource` accepts an asynchronous function you can use to apply updates to a signal value over time. The signal being updated represents the data being streamed.
65-
66-
```ts
67-
characters = resource({
68-
stream: async () => {
69-
const data = signal<{ value: string } | { error: unknown }>({
70-
value: "",
71-
});
72-
73-
fetch(this.url).then(async (response) => {
74-
if (!response.body) return;
75-
76-
for await (const chunk of response.body) {
77-
const chunkText = this.decoder.decode(chunk);
78-
data.update((prev) => {
79-
if ("value" in prev) {
80-
return { value: `${prev.value} ${chunkText}` };
81-
} else {
82-
return { error: chunkText };
83-
}
84-
});
85-
}
86-
});
87-
88-
return data;
89-
},
90-
});
91-
92-
```
93-
94-
The `characters` member is updated asynchronously and can be displayed in the template.
95-
96-
```html
97-
<p>{{ characters.value() }}</p>
98-
```
99-
100-
On the server side, in `server.ts` for example, the defined endpoint sends the data to be streamed to the client. The following code uses the Gemini API but this technique is applicable to other tools and frameworks that support streaming responses from LLMs:
101-
102-
```ts
103-
app.get("/api/stream-response", async (req, res) => {
104-
ai.models.generateContentStream({
105-
model: "gemini-2.0-flash",
106-
contents: "Explain how AI works",
107-
}).then(async (response) => {
108-
for await (const chunk of response) {
109-
res.write(chunk.text);
110-
}
111-
});
112-
});
113-
114-
```
115-
This example connects to the Gemini API but other APIs that support streaming responses can be used here as well. [You can find the complete example on the Angular Github](https://github.com/angular/examples/tree/main/streaming-example).
116-
11763
## Best Practices
11864
### Connecting to model providers and keeping your API Credentials Secure
11965
When connecting to model providers, it is important to keep your API secrets safe. *Never put your API key in a file that ships to the client, such as `environments.ts`*.

0 commit comments

Comments
 (0)