Posts

First AI project

Using Google Gemini API with pydantic-ai ✨ Using Google Gemini API with pydantic-ai Objective Use the Google Gemini API with the pydantic-ai Python library to send a question and receive a concise response. Prerequisites Python 3 installed ( pip3 available) Google Gemini API Key (from Google AI Studio or Google Cloud Console) Step 1: Obtain Gemini API Key Go to Google AI Studio . Generate a new API Key for the Gemini API. Copy and store the API key safely – DO NOT SHARE it. Step 2: Install pydantic-ai Library pip3 install pydantic-ai Step 3: Set Environment Variable Make sure the key is available in your current terminal session. Linux/macOS: export GEMINI_API_KEY="YOUR_API_KEY_HERE" Windows (Command Prompt): set GEMINI_API_KEY="YOUR_API_KEY_HERE" Windows (PowerShell): $env:GEMINI_API_KEY="YOUR_API_KEY_HERE" Note: Only valid for the cur...

1. Create AEM project using arch type 23

  Topic to cover Create AEM project using maven archtype 23 1. How to create a project 2. How to add core component to project 3. How to add ACS common to project 4. How to add third party bundle/jar to project .  Inside .m2 have below setting.xml <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.  You may obtain a copy of the License at     http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See...

Sling Servlet

Image
 Lets start with code and understand line by line. @Component(service = { Servlet.class }) @SlingServletResourceTypes(         resourceTypes="reactLearning/components/page",         methods=HttpConstants.METHOD_GET,         extensions="txt") @ServiceDescription("Simple Demo Servlet") public class SimpleServlet extends SlingSafeMethodsServlet { @Component: Identify the annotated class as a Service Component. The annotated class is the implementation class of the Component. This annotation is not processed at runtime by Service Component Runtime. It must be processed by tools and used to add a Component Description to the bundle. Service Property: This signifies the types under which to register this component as a service. In our case, the component is registered under the Servlet type.

AEM with react.

Image
Installing AEM locally and integrating React for front end is actually more straight-forward than described in the  official Adobe documentation . If you tried to follow their guide and got lost in details or errors, the steps below should help. Follow through and if you encounter errors, please add them in the comments section. For this tutorial I’m installing everything directly in C:\. What we’ll cover Install Java & set up the environment variable Install Apache Maven Install Node.js and npm Install AEM 6.5 locally Add the adobe-public-profile to your Maven settings.xml file Customize your IDE for AEM work Generate a new project with the AEM archetype Install React with CRA Integrate React into the AEM instance In part II, we’ll look at how to Install and integrate the AEM SPA Editor JS SDK. Install Java 1.8+ and set up the environment variable Download Java 1.8+  here  and install it. Open a new command line and check if the installation was performed properly by...