Python Archives - gettectonic.com - Page 2
Exploring Large Action Models

Exploring Large Action Models

Exploring Large Action Models (LAMs) for Automated Workflow Processes While large language models (LLMs) are effective in generating text and media, Large Action Models (LAMs) push beyond simple generation—they perform complex tasks autonomously. Imagine an AI that not only generates content but also takes direct actions in workflows, such as managing customer relationship management (CRM) tasks, sending emails, or making real-time decisions. LAMs are engineered to execute tasks across various environments by seamlessly integrating with tools, data, and systems. They adapt to user commands, making them ideal for applications in industries like marketing, customer service, and beyond. Key Capabilities of LAMs A standout feature of LAMs is their ability to perform function-calling tasks, such as selecting the appropriate APIs to meet user requirements. Salesforce’s xLAM models are designed to optimize these tasks, achieving high performance with lower resource demands—ideal for both mobile applications and high-performance environments. The fc series models are specifically tuned for function-calling, enabling fast, precise, and structured responses by selecting the best APIs based on input queries. Practical Examples Using Salesforce LAMs In this article, we’ll explore: Implementation: Setting Up the Model and API Start by installing the necessary libraries: pythonCopy code! pip install transformers==4.41.0 datasets==2.19.1 tokenizers==0.19.1 flask==2.2.5 Next, load the xLAM model and tokenizer: pythonCopy codeimport json import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_name = “Salesforce/xLAM-7b-fc-r” model = AutoModelForCausalLM.from_pretrained(model_name, device_map=”auto”, torch_dtype=”auto”, trust_remote_code=True) tokenizer = AutoTokenizer.from_pretrained(model_name) Now, define instructions and available functions. Task Instructions: The model will use function calls where applicable, based on user questions and available tools. Format Example: jsonCopy code{ “tool_calls”: [ {“name”: “func_name1”, “arguments”: {“argument1”: “value1”, “argument2”: “value2”}} ] } Define available APIs: pythonCopy codeget_weather_api = { “name”: “get_weather”, “description”: “Retrieve weather details”, “parameters”: {“location”: “string”, “unit”: “string”} } search_api = { “name”: “search”, “description”: “Search for online information”, “parameters”: {“query”: “string”} } Creating Flask APIs for Business Logic We can use Flask to create APIs to replicate business processes. pythonCopy codefrom flask import Flask, request, jsonify app = Flask(__name__) @app.route(“/customer”, methods=[‘GET’]) def get_customer(): customer_id = request.args.get(‘customer_id’) # Return dummy customer data return jsonify({“customer_id”: customer_id, “status”: “active”}) @app.route(“/send_email”, methods=[‘GET’]) def send_email(): email = request.args.get(’email’) # Return dummy response for email send status return jsonify({“status”: “sent”}) Testing the LAM Model and Flask APIs Define queries to test LAM’s function-calling capabilities: pythonCopy codequery = “What’s the weather like in New York in fahrenheit?” print(custom_func_def(query)) # Expected: {“tool_calls”: [{“name”: “get_weather”, “arguments”: {“location”: “New York”, “unit”: “fahrenheit”}}]} Function-Calling Models in Action Using base_call_api, LAMs can determine the correct API to call and manage workflow processes autonomously. pythonCopy codedef base_call_api(query): “””Calls APIs based on LAM recommendations.””” base_url = “http://localhost:5000/” json_response = json.loads(custom_func_def(query)) api_url = json_response[“tool_calls”][0][“name”] params = json_response[“tool_calls”][0][“arguments”] response = requests.get(base_url + api_url, params=params) return response.json() With LAMs, businesses can automate and streamline tasks in complex workflows, maximizing efficiency and empowering teams to focus on strategic initiatives. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More

Linus Torvalds Insights

Linus Torvalds Shares Insights on the Future of Programming with AI Linus Torvalds, the mastermind behind Linux and Git—two cornerstones of modern software development—recently shared his perspective on how artificial intelligence (AI) is reshaping the world of programming. His candid insights offer a balanced view of AI’s capabilities and limitations, coming from one of the industry’s most influential voices. If you prefer a quick breakdown over watching a full interview, here are the key takeaways from Torvalds’ conversation. AI in Programming: Evolution, Not Revolution Torvalds describes AI, particularly large language models (LLMs), as “autocorrect on steroids.” These tools excel at predicting the next word or line of code based on established patterns but aren’t “intelligent” in the human sense. Rather than a seismic shift, AI represents the next step in a long history of automation in coding. From the days of machine language to today’s high-level languages like Python and Rust, tools have continuously evolved to make developers’ lives easier. AI is just another link in this chain—helping write, refine, and debug code while boosting productivity. AI as a Developer’s Supercharged Assistant Far from being a replacement for human programmers, Torvalds sees AI as a powerful assistant. Tools like GitHub Copilot are already enhancing the coding process by suggesting fixes, spotting bugs, and speeding up routine tasks. The vision? A future where programmers can abstract tasks even further, possibly instructing AI in plain English. Imagine simply saying, “Build me a tool to manage my expenses,” and watching it happen. However, for now, AI is an incremental improvement, not a groundbreaking leap. The Shift Toward AI-Generated Code One of Torvalds’ more intriguing predictions is that AI may eventually write code in ways incomprehensible to human programmers. Since AI doesn’t require human-readable syntax, it could optimize code in ways that only it understands. In this scenario, developers might transition from writing code to managing AI systems that generate and refine it—shifting from hands-on creators to overseers of automated processes. AI in Code Review: Smarter Intern or Future Partner? When it comes to code review, AI’s potential is clear. Torvalds notes that AI could efficiently catch simple errors—like typos or syntax mistakes—freeing up human reviewers to focus on more complex logic and functionality. While AI might streamline tedious tasks, it’s far from perfect. Issues like “hallucinations,” where AI confidently produces incorrect results, highlight the need for human oversight. AI can assist, but it still requires developers to verify its output. A Balanced Take on AI and Jobs Torvalds dismisses fears of AI taking over programming jobs, pointing out that technological advancements historically create new opportunities rather than eliminate roles. AI, in his view, is less about replacing humans and more about augmenting their abilities. It’s a tool to make developers more efficient—not a harbinger of obsolescence. Final Thoughts: Embrace AI, But Stay Grounded Linus Torvalds envisions AI as a valuable, evolving tool for programmers, not a threat to their livelihood. While it’s set to change how we code, the shift will be gradual rather than revolutionary. Whether you’re a seasoned developer or a newcomer, now is the time to explore AI-powered tools, embrace their potential, and adapt to this new era of programming. Instead of fearing change, we can use AI to push the boundaries of what’s possible. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
Slack Automation with New Workflow Features

Slack Automation with New Workflow Features

Salesforce Expands Slack Automation with New Workflow Features Salesforce has introduced new capabilities in Slack, allowing customers to build workflows that automatically trigger when an event occurs in third-party apps like PagerDuty, Asana, Bitbucket, and others. This update also enhances the user experience, making it more intuitive to create workflows in Slack. Users now have access to over 50 plug-and-play templates tailored to common productivity tasks. Additionally, developers gain access to more coding languages and tools for building custom workflows, which can be easily shared with their teams. Why It Matters Key Highlights Workflow Builder, Slack’s no-code automation tool, empowers users to streamline tasks directly within Slack, reducing the burden on IT teams. Salesforce highlights the following new features: From Slack’s Perspective Slack has also made it easier to customize workflows with expanded developer tools. Developers can now build custom steps using open APIs and new developer resources, integrating these steps into Workflow Builder. These tools support additional programming languages, including JavaScript, TypeScript, Python, and Java, further enhancing the flexibility of custom workflows. According to Rob Seaman, Slack’s Chief Product Officer, “At Slack, one of our product principles is ‘don’t make me think.’ We’re applying that to automation, making it intuitive and delightful for everyone. These new features empower both developers and end users to automate any business process across their apps seamlessly in Slack.” What This Means for Businesses As companies seek ways to increase productivity without overloading IT teams, automation has become a critical solution. Tools like Slack’s no-code Workflow Builder enable users of any skill level to automate repetitive tasks, freeing up time for more strategic work. This is particularly important in an era where skilled workers, especially in data science and programming, are in short supply. The expanded capabilities in Workflow Builder make it easier to create powerful workflows that integrate with third-party systems. In addition, Salesforce has expanded Slack AI, initially launched in April as an add-on for paying customers, to support multiple languages, including Japanese and Spanish. This ongoing development strengthens Slack’s position as a central hub for workplace automation. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
Slack Operating System

Slack Operating System

Slack Advances Its Work Operating System with Enhanced Automation Capabilities With 3,000 workflows created this year alone, Rivian relies on Slack’s automation features to save time and boost team productivity. Slack Operating System are making a world of difference. Salesforce has announced new innovations in Slack, making it easier for users to build automations regardless of their technical expertise. Key Updates: Why This Matters: With 71% of business leaders under pressure to increase team productivity, and 70% of IT leaders concerned that rising business demands could stifle innovation, automation is crucial. A recent survey reveals that 77% of users believe automating routine tasks would significantly boost productivity. Companies need user-friendly, no-code automation solutions that enhance productivity without overburdening IT departments. A Closer Look: Slack’s Perspective: Rob Seaman, Chief Product Officer at Slack, stated, “At Slack, one of our product principles is ‘don’t make me think.’ We’re applying that principle to the traditionally technical and time-consuming area of automation, making it an intuitive and delightful productivity driver for everyone. These new features make Slack even more powerful, giving both developers and end users the tools they need to automate any business process across their work apps.” Customer Reaction: “Automation is a core capability that increases productivity and saves time for Rivian employees when doing repetitive work. Workflow Builder allows Slack users to easily create no-code automation at any experience level. Our Slack users created approximately 3,000 workflows in 2024, with heavy adoption in Production, Operation, and Service groups,” said Anoop Narang, Head of Digital Workplace & Solutions at Rivian. Availability: The enhancements to Workflow Builder are now generally available to all customers. Other app updates you might have missed. Slack 4.40.120 August 27, 2024 Bug Fixes Slack 4.39.95 July 29, 2024 Bug Fixes Slack 4.39.93 July 18, 2024 Bug Fixes Slack 4.39.90 July 8, 2024 Bug Fixes Slack 4.39.89 June 25, 2024 Bug Fixes Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
GitHub Copilot Autofix

GitHub Copilot Autofix

On Wednesday, GitHub announced the general availability of Copilot Autofix, an AI-driven tool designed to identify and remediate software vulnerabilities. Originally unveiled in March and tested in public beta, Copilot Autofix integrates GitHub’s CodeQL scanning engine with GPT-4, heuristics, and Copilot APIs to generate code suggestions for developers. The tool provides prompts based on CodeQL analysis and code snippets, allowing users to accept, edit, or reject the suggestions. In a blog post, Mike Hanley, GitHub’s Chief Security Officer and Senior Vice President of Engineering, highlighted the challenges developers and security teams face in addressing existing vulnerabilities. “Code scanning tools can find vulnerabilities, but the real issue is remediation, which requires security expertise and time—both of which are in short supply,” Hanley noted. “The problem isn’t finding vulnerabilities; it’s fixing them.” According to GitHub, the private beta of Copilot Autofix showed that users could respond to a CodeQL alert and automatically remediate a vulnerability in a pull request in just 28 minutes on average, compared to 90 minutes for manual remediation. The tool was even faster for common vulnerabilities like cross-site scripting, with remediation times averaging 22 minutes compared to three hours manually, and SQL injection flaws, which were fixed in 18 minutes on average versus almost four hours manually. Hanley likened the efficiency of Copilot Autofix in fixing vulnerabilities to the speed at which GitHub Copilot, their generative AI coding assistant released in 2022, produces code for developers. However, there have been concerns that GitHub Copilot and similar AI coding assistants could replicate existing vulnerabilities in the codebases they help generate. Industry analyst Katie Norton from IDC noted that while the replication of vulnerabilities is concerning, the rapid pace at which AI coding assistants generate new software could pose a more significant security issue. Chris Wysopal, CTO and co-founder of Veracode, echoed this concern, pointing out that faster coding speeds have led to more software being produced and a larger backlog of vulnerabilities for developers to manage. Norton also emphasized that AI-powered tools like Copilot Autofix could help alleviate the burden on developers by reducing these backlogs and enabling them to fix vulnerabilities without needing to be security experts. Other vendors, including Mobb and Snyk, have also developed AI-powered autoremediation tools. Initially supporting JavaScript, TypeScript, Java, and Python during its public beta, Copilot Autofix now also supports C#, C/C++, Go, Kotlin, Swift, and Ruby. Hanley also highlighted that Copilot Autofix would benefit the open-source software community. GitHub has previously provided open-source maintainers with free access to enterprise security tools for code scanning, secret scanning, and dependency management. Starting in September, Copilot Autofix will also be made available for free to these maintainers. “As the global home of the open-source community, GitHub is uniquely positioned to help maintainers detect and remediate vulnerabilities, making open-source software safer and more reliable for everyone,” Hanley said. Copilot Autofix is now available to all GitHub customers globally. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
Small Language Models

Small Language Models

Large language models (LLMs) like OpenAI’s GPT-4 have gained acclaim for their versatility across various tasks, but they come with significant resource demands. In response, the AI industry is shifting focus towards smaller, task-specific models designed to be more efficient. Microsoft, alongside other tech giants, is investing in these smaller models. Science often involves breaking complex systems down into their simplest forms to understand their behavior. This reductionist approach is now being applied to AI, with the goal of creating smaller models tailored for specific functions. Sébastien Bubeck, Microsoft’s VP of generative AI, highlights this trend: “You have this miraculous object, but what exactly was needed for this miracle to happen; what are the basic ingredients that are necessary?” In recent years, the proliferation of LLMs like ChatGPT, Gemini, and Claude has been remarkable. However, smaller language models (SLMs) are gaining traction as a more resource-efficient alternative. Despite their smaller size, SLMs promise substantial benefits to businesses. Microsoft introduced Phi-1 in June last year, a smaller model aimed at aiding Python coding. This was followed by Phi-2 and Phi-3, which, though larger than Phi-1, are still much smaller than leading LLMs. For comparison, Phi-3-medium has 14 billion parameters, while GPT-4 is estimated to have 1.76 trillion parameters—about 125 times more. Microsoft touts the Phi-3 models as “the most capable and cost-effective small language models available.” Microsoft’s shift towards SLMs reflects a belief that the dominance of a few large models will give way to a more diverse ecosystem of smaller, specialized models. For instance, an SLM designed specifically for analyzing consumer behavior might be more effective for targeted advertising than a broad, general-purpose model trained on the entire internet. SLMs excel in their focused training on specific domains. “The whole fine-tuning process … is highly specialized for specific use-cases,” explains Silvio Savarese, Chief Scientist at Salesforce, another company advancing SLMs. To illustrate, using a specialized screwdriver for a home repair project is more practical than a multifunction tool that’s more expensive and less focused. This trend towards SLMs reflects a broader shift in the AI industry from hype to practical application. As Brian Yamada of VLM notes, “As we move into the operationalization phase of this AI era, small will be the new big.” Smaller, specialized models or combinations of models will address specific needs, saving time and resources. Some voices express concern over the dominance of a few large models, with figures like Jack Dorsey advocating for a diverse marketplace of algorithms. Philippe Krakowski of IPG also worries that relying on the same models might stifle creativity. SLMs offer the advantage of lower costs, both in development and operation. Microsoft’s Bubeck emphasizes that SLMs are “several orders of magnitude cheaper” than larger models. Typically, SLMs operate with around three to four billion parameters, making them feasible for deployment on devices like smartphones. However, smaller models come with trade-offs. Fewer parameters mean reduced capabilities. “You have to find the right balance between the intelligence that you need versus the cost,” Bubeck acknowledges. Salesforce’s Savarese views SLMs as a step towards a new form of AI, characterized by “agents” capable of performing specific tasks and executing plans autonomously. This vision of AI agents goes beyond today’s chatbots, which can generate travel itineraries but not take action on your behalf. Salesforce recently introduced a 1 billion-parameter SLM that reportedly outperforms some LLMs on targeted tasks. Salesforce CEO Mark Benioff celebrated this advancement, proclaiming, “On-device agentic AI is here!” Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
guide to RAG

Tectonic Guide to RAG

Guide to RAG (Retrieval-Augmented Generation) Retrieval-Augmented Generation (RAG) has become increasingly popular, and while it’s not yet as common as seeing it on a toaster oven manual, it is expected to grow in use. Despite its rising popularity, comprehensive guides that address all its nuances—such as relevance assessment and hallucination prevention—are still scarce. Drawing from practical experience, this insight offers an in-depth overview of RAG. Why is RAG Important? Large Language Models (LLMs) like ChatGPT can be employed for a wide range of tasks, from crafting horoscopes to more business-centric applications. However, there’s a notable challenge: most LLMs, including ChatGPT, do not inherently understand the specific rules, documents, or processes that companies rely on. There are two ways to address this gap: How RAG Works RAG consists of two primary components: While the system is straightforward, the effectiveness of the output heavily depends on the quality of the documents retrieved and how well the Retriever performs. Corporate documents are often unstructured, conflicting, or context-dependent, making the process challenging. Search Optimization in RAG To enhance RAG’s performance, optimization techniques are used across various stages of information retrieval and processing: Python and LangChain Implementation Example Below is a simple implementation of RAG using Python and LangChain: pythonCopy codeimport os import wget from langchain.vectorstores import Qdrant from langchain.embeddings import OpenAIEmbeddings from langchain import OpenAI from langchain_community.document_loaders import BSHTMLLoader from langchain.chains import RetrievalQA # Download ‘War and Peace’ by Tolstoy wget.download(“http://az.lib.ru/t/tolstoj_lew_nikolaewich/text_0073.shtml”) # Load text from html loader = BSHTMLLoader(“text_0073.shtml”, open_encoding=’ISO-8859-1′) war_and_peace = loader.load() # Initialize Vector Database embeddings = OpenAIEmbeddings() doc_store = Qdrant.from_documents( war_and_peace, embeddings, location=”:memory:”, collection_name=”docs”, ) llm = OpenAI() # Ask questions while True: question = input(‘Your question: ‘) qa = RetrievalQA.from_chain_type( llm=llm, chain_type=”stuff”, retriever=doc_store.as_retriever(), return_source_documents=False, ) result = qa(question) print(f”Answer: {result}”) Considerations for Effective RAG Ranking Techniques in RAG Dynamic Learning with RELP An advanced technique within RAG is Retrieval-Augmented Language Model-based Prediction (RELP). In this method, information retrieved from vector storage is used to generate example answers, which the LLM can then use to dynamically learn and respond. This allows for adaptive learning without the need for expensive retraining. Guide to RAG RAG offers a powerful alternative to retraining large language models, allowing businesses to leverage their proprietary knowledge for practical applications. While setting up and optimizing RAG systems involves navigating various complexities, including document structure, query processing, and ranking, the results are highly effective for most business use cases. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more Alphabet Soup of Cloud Terminology As with any technology, the cloud brings its own alphabet soup of terms. This insight will hopefully help you navigate Read more

Read More
Einstein Code Generation and Amazon SageMaker

Einstein Code Generation and Amazon SageMaker

Salesforce and the Evolution of AI-Driven CRM Solutions Salesforce, Inc., headquartered in San Francisco, California, is a leading American cloud-based software company specializing in customer relationship management (CRM) software and applications. Their offerings include sales, customer service, marketing automation, e-commerce, analytics, and application development. Salesforce is at the forefront of integrating artificial general intelligence (AGI) into its services, enhancing its flagship SaaS CRM platform with predictive and generative AI capabilities and advanced automation features. Einstein Code Generation and Amazon SageMaker. Salesforce Einstein: Pioneering AI in Business Applications Salesforce Einstein represents a suite of AI technologies embedded within Salesforce’s Customer Success Platform, designed to enhance productivity and client engagement. With over 60 features available across different pricing tiers, Einstein’s capabilities are categorized into machine learning (ML), natural language processing (NLP), computer vision, and automatic speech recognition. These tools empower businesses to deliver personalized and predictive customer experiences across various functions, such as sales and customer service. Key components include out-of-the-box AI features like sales email generation in Sales Cloud and service replies in Service Cloud, along with tools like Copilot, Prompt, and Model Builder within Einstein 1 Studio for custom AI development. The Salesforce Einstein AI Platform Team: Enhancing AI Capabilities The Salesforce Einstein AI Platform team is responsible for the ongoing development and enhancement of Einstein’s AI applications. They focus on advancing large language models (LLMs) to support a wide range of business applications, aiming to provide cutting-edge NLP capabilities. By partnering with leading technology providers and leveraging open-source communities and cloud services like AWS, the team ensures Salesforce customers have access to the latest AI technologies. Optimizing LLM Performance with Amazon SageMaker In early 2023, the Einstein team sought a solution to host CodeGen, Salesforce’s in-house open-source LLM for code understanding and generation. CodeGen enables translation from natural language to programming languages like Python and is particularly tuned for the Apex programming language, integral to Salesforce’s CRM functionality. The team required a hosting solution that could handle a high volume of inference requests and multiple concurrent sessions while meeting strict throughput and latency requirements for their EinsteinGPT for Developers tool, which aids in code generation and review. After evaluating various hosting solutions, the team selected Amazon SageMaker for its robust GPU access, scalability, flexibility, and performance optimization features. SageMaker’s specialized deep learning containers (DLCs), including the Large Model Inference (LMI) containers, provided a comprehensive solution for efficient LLM hosting and deployment. Key features included advanced batching strategies, efficient request routing, and access to high-end GPUs, which significantly enhanced the model’s performance. Key Achievements and Learnings Einstein Code Generation and Amazon SageMaker The integration of SageMaker resulted in a dramatic improvement in the performance of the CodeGen model, boosting throughput by over 6,500% and reducing latency significantly. The use of SageMaker’s tools and resources enabled the team to optimize their models, streamline deployment, and effectively manage resource use, setting a benchmark for future projects. Conclusion and Future Directions Salesforce’s experience with SageMaker highlights the critical importance of leveraging advanced tools and strategies in AI model optimization. The successful collaboration underscores the need for continuous innovation and adaptation in AI technologies, ensuring that Salesforce remains at the cutting edge of CRM solutions. For those interested in deploying their LLMs on SageMaker, Salesforce’s experience serves as a valuable case study, demonstrating the platform’s capabilities in enhancing AI performance and scalability. To begin hosting your own LLMs on SageMaker, consider exploring their detailed guides and resources. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
Gen AI and Test Automation

Gen AI and Test Automation

Generative AI has brought transformative advancements across industries, and test automation is no exception. By generating code, test scenarios, and even entire suites, Generative AI enables Software Development Engineers in Test (SDETs) to boost efficiency, expand test coverage, and improve reliability. 1. Enhanced Test Case Generation One of the biggest hurdles in test automation is generating diverse, comprehensive test cases. Traditional methods often miss edge cases or diverse scenarios. Generative AI, however, can analyze existing data and automatically generate extensive test cases, including potential edge cases that may not be apparent to human testers. Example: An SDET can use Generative AI to create test cases for a web application by feeding it requirements and user data. This enables the AI to produce hundreds of test cases, capturing diverse user behaviors and interactions that manual testers may overlook. pythonCopy codeimport openai openai.api_key = ‘YOUR_API_KEY’ def generate_test_cases(application_description): response = openai.Completion.create( engine=”text-davinci-003″, prompt=f”Generate comprehensive test cases for the following application: {application_description}”, max_tokens=500 ) return response.choices[0].text app_description = “An e-commerce platform for browsing products, adding to cart, and checking out.” test_cases = generate_test_cases(app_description) print(test_cases) Sample Output: 2. Intelligent Test Script Creation Writing test scripts manually can be labor-intensive and error-prone. Generative AI can simplify this by generating test scripts based on an application’s flow, ensuring consistency and precision. Example: If an SDET needs to automate tests for a mobile app, they can use Generative AI to generate scripts for various scenarios, significantly reducing manual work. pythonCopy codeimport hypothetical_ai_test_tool ui_description = “”” Login Page: – Username field – Password field – Login button Home Page: – Search bar – Product listings – Add to cart buttons “”” test_scripts = hypothetical_ai_test_tool.generate_selenium_scripts(ui_description) Sample Output for test_login.py: pythonCopy codefrom selenium import webdriver from selenium.webdriver.common.keys import Keys def test_login(): driver = webdriver.Chrome() driver.get(“http://example.com/login”) username_field = driver.find_element_by_name(“username”) password_field = driver.find_element_by_name(“password”) login_button = driver.find_element_by_name(“login”) username_field.send_keys(“testuser”) password_field.send_keys(“password”) login_button.click() assert “Home” in driver.title driver.quit() 3. Automated Maintenance of Test Suites As applications evolve, maintaining test suites is critical. Generative AI can monitor app changes and update test cases automatically, keeping test suites accurate and relevant. Example: In a CI/CD pipeline, an SDET can deploy Generative AI to track code changes and update affected test scripts. This minimizes downtime and ensures tests stay aligned with application updates. pythonCopy codeimport hypothetical_ai_maintenance_tool def maintain_test_suite(): changes = hypothetical_ai_maintenance_tool.analyze_code_changes() updated_scripts = hypothetical_ai_maintenance_tool.update_test_scripts(changes) for script_name, script_content in updated_scripts.items(): with open(script_name, ‘w’) as file: file.write(script_content) maintain_test_suite() Sample Output:“Updating test_login.py with new login flow changes… Test scripts updated successfully.” 4. Natural Language Processing for Test Case Design Generative AI with NLP can interpret human language, enabling SDETs to create test cases from plain-language descriptions, enhancing collaboration across technical and non-technical teams. Example: An SDET can use an NLP-powered tool to translate a feature description from a product manager into test cases. This speeds up the process and ensures that test cases reflect intended functionality. pythonCopy codeimport openai openai.api_key = ‘YOUR_API_KEY’ def create_test_cases(description): response = openai.Completion.create( engine=”text-davinci-003″, prompt=f”Create test cases based on this feature description: {description}”, max_tokens=500 ) return response.choices[0].text feature_description = “Allow users to reset passwords via email to regain account access.” test_cases = create_test_cases(feature_description) print(test_cases) Sample Output: 5. Predictive Analytics for Test Prioritization Generative AI can analyze historical data to prioritize high-risk areas, allowing SDETs to focus testing on critical functionalities. Example: An SDET can use predictive analytics to identify areas with frequent bugs, allocating resources more effectively and ensuring robust testing of high-risk components. pythonCopy codeimport hypothetical_ai_predictive_tool def prioritize_tests(): risk_areas = hypothetical_ai_predictive_tool.predict_risk_areas() prioritized_tests = hypothetical_ai_predictive_tool.prioritize_test_cases(risk_areas) return prioritized_tests prioritized_test_cases = prioritize_tests() print(“Prioritized Test Cases:”) for test in prioritized_test_cases: print(test) Sample Output: Gen AI and Test Automation Generative AI has the potential to revolutionize test automation, offering SDETs tools to enhance efficiency, coverage, and reliability. By embracing Generative AI for tasks like test case generation, script creation, suite maintenance, NLP-based design, and predictive prioritization, SDETs can reduce manual effort and focus on strategic tasks, accelerating testing processes and ensuring robust, reliable software systems. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
AI Training Options

AI Training Options

As AI adoption accelerates, AI certifications and courses have proliferated, providing deeper knowledge of this rapidly evolving technology. AI Training Options. Numerous AI certifications cover the basics, so we’ve narrowed the field to 10 of the most diverse and comprehensive programs. AI Training Options Artificial intelligence is poised to become the key technology that drives business transformation and gives companies a competitive edge. According to a recent forecast by the International Data Corporation, global spending on AI—including AI-enabled applications, infrastructure, and related services—will more than double to $632 billion by 2028, growing at a compound annual rate of 29% between 2024 and 2028. AI helps businesses boost productivity by automating processes such as robotics and autonomous vehicles, while also supporting existing workforces with technologies like assisted and augmented intelligence. Companies are integrating AI across various sectors, including finance, healthcare, retail, smart home devices, fraud detection, and security surveillance. Why AI certifications are important: 10 of the best AI certifications and courses: Each certification offers unique benefits, whether you’re a beginner or an experienced professional aiming to stay ahead in AI-driven industries. Content updated September 2024. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
Zapier for Salesforce

Salesforce and Zapier and Anything You Can Imagine

Zapier enables you to connect Salesforce with thousands of the most popular third-party apps, so you can automate your work and have more time for what matters most—no code required. Providing easy automation for busy Salesforce users. Zapier transfers info between your web apps automatically, so you can focus on your most important work. Zapier is “middleware” that sits between two other services. It allows software services to create Triggers and Actions. Each combination of a Trigger and an Action is called a Zap. Triggers are how your app’s users can start automated workflows whenever an item is added or updated in your app. There are two types of triggers in Zapier: Actions are how your app’s use the data. The action is the effect of the cause (trigger). What is the difference between actions and triggers in Zapier? Every Zap starts with a single trigger that watches for new or updated data, starting the user’s workflow. Action steps then make use of that data. Zapier actions create or update a single item in your app through API calls that include multiple details from user customized input fields. Is Zapier considered an API? Yes, Zapier is an API tool. Zapier is a web-based automation tool that allows you to connect and automate different web services and applications without the need for any coding. It uses APIs (Application Programming Interfaces) to communicate with the different services and applications that it connects to. About AI by Zapier Smart task and text handling powered by a flexible AI. Create text prompts to perform standard tasks like extracting lead (or other) data or answering discrete questions like “where should this message be routed?”. Or, create your own! What coding language does Zapier use? Zapier is a monolithic application built on Python and Django. There’s a lot of momentum with Python and it is very difficult changing course to another programming language while the service is running. Why is Zapier so popular? Zapier is a powerful tool for automating workflows and combining different business applications without requiring any additional coding skills. Is Zapier actually useful? Users have found that Zapier is a versatile automation tool that simplifies complex problems and enhances efficiency in various industries. With its easy-to-use interface, users can create automation workflows and connect different apps and platforms seamlessly. Around the world in 2024, over 9973 companies have started using Zapier as Integration tool. Netflix, Inc. PayPal Holdings, Inc. Trimble, Inc. If you need assistance connecting apps to Salesforce with Zapier, contact Tectonic today. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
Python Alongside Salesforce

Python Alongside Salesforce

Salesforce can integrate with Python, though the platform primarily relies on its proprietary languages and frameworks for core development. Python, however, plays a crucial role in enhancing Salesforce’s capabilities through integrations, automation, data analysis, and extending functionalities via external applications. Here’s an overview of how Python works within the Salesforce ecosystem: 1. Salesforce’s Core Development Stack Before exploring Python’s use, it’s important to understand the key development tools within Salesforce: These tools are the foundation for Salesforce development. However, Python complements Salesforce by enabling integrations and automation that go beyond these native tools. 2. Python in Salesforce Integrations Python shines when integrating Salesforce with other systems, automating workflows, and extending functionality. Here’s how: a. API Interactions Salesforce’s REST and SOAP APIs allow external systems to communicate with Salesforce data. Python, with its powerful libraries, is excellent for interfacing with these APIs. Key Libraries: Example: Extracting Data via API: pythonCopy codefrom simple_salesforce import Salesforce # Connect to Salesforce sf = Salesforce(username=’your_username’, password=’your_password’, security_token=’your_token’) # Query Salesforce data accounts = sf.query(“SELECT Id, Name FROM Account LIMIT 10”) for account in accounts[‘records’]: print(account[‘Name’]) b. Data Processing and Analysis Python’s data manipulation libraries like Pandas and NumPy make it ideal for processing Salesforce data. Example: Data Cleaning and Analysis: pythonCopy codeimport pandas as pd from simple_salesforce import Salesforce # Connect to Salesforce sf = Salesforce(username=’your_username’, password=’your_password’, security_token=’your_token’) # Fetch data query = “SELECT Id, Name, AnnualRevenue FROM Account” accounts = sf.query_all(query) df = pd.DataFrame(accounts[‘records’]).drop(columns=[‘attributes’]) # Process data df[‘AnnualRevenue’] = df[‘AnnualRevenue’].fillna(0) high_revenue_accounts = df[df[‘AnnualRevenue’] > 1000000] print(high_revenue_accounts) 3. Automation and Scripting Python can automate Salesforce-related tasks, improving productivity and reducing manual effort. This can involve automating data updates, generating reports, or scheduling backups. Example: Automating Data Backup: pythonCopy codeimport schedule import time from simple_salesforce import Salesforce def backup_salesforce_data(): sf = Salesforce(username=’your_username’, password=’your_password’, security_token=’your_token’) query = “SELECT Id, Name, CreatedDate FROM Contact” contacts = sf.query_all(query) df = pd.DataFrame(contacts[‘records’]).drop(columns=[‘attributes’]) df.to_csv(‘contacts_backup.csv’, index=False) print(“Salesforce data backed up successfully.”) # Schedule the backup schedule.every().day.at(“00:00”).do(backup_salesforce_data) while True: schedule.run_pending() time.sleep(1) 4. Building External Applications Using platforms like Heroku, developers can build external applications in Python that integrate with Salesforce, extending its functionality for custom portals or advanced analytics. Example: Web App Integrating with Salesforce: pythonCopy codefrom flask import Flask, request, jsonify from simple_salesforce import Salesforce app = Flask(__name__) @app.route(‘/get_accounts’, methods=[‘GET’]) def get_accounts(): sf = Salesforce(username=’your_username’, password=’your_password’, security_token=’your_token’) accounts = sf.query(“SELECT Id, Name FROM Account LIMIT 10”) return jsonify(accounts[‘records’]) if __name__ == ‘__main__’: app.run(debug=True) 5. Data Integration and ETL Python is commonly used in ETL (Extract, Transform, Load) processes that involve Salesforce data. Tools like Apache Airflow allow you to create complex data pipelines for integrating Salesforce data with external databases. Example: ETL Pipeline with Airflow: pythonCopy codefrom airflow import DAG from airflow.operators.python_operator import PythonOperator from simple_salesforce import Salesforce import pandas as pd from datetime import datetime def extract_salesforce_data(): sf = Salesforce(username=’your_username’, password=’your_password’, security_token=’your_token’) query = “SELECT Id, Name, CreatedDate FROM Opportunity” opportunities = sf.query_all(query) df = pd.DataFrame(opportunities[‘records’]).drop(columns=[‘attributes’]) df.to_csv(‘/path/to/data/opportunities.csv’, index=False) default_args = { ‘owner’: ‘airflow’, ‘start_date’: datetime(2023, 1, 1), ‘retries’: 1, } dag = DAG(‘salesforce_etl’, default_args=default_args, schedule_interval=’@daily’) extract_task = PythonOperator( task_id=’extract_salesforce_data’, python_callable=extract_salesforce_data, dag=dag, ) extract_task 6. Machine Learning and Predictive Analytics Python’s machine learning libraries, such as Scikit-learn and TensorFlow, enable predictive analytics on Salesforce data. This helps in building models for sales forecasting, lead scoring, and customer behavior analysis. Example: Predicting Lead Conversion: pythonCopy codeimport pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from simple_salesforce import Salesforce # Fetch Salesforce data sf = Salesforce(username=’your_username’, password=’your_password’, security_token=’your_token’) query = “SELECT Id, LeadSource, AnnualRevenue, NumberOfEmployees, Converted FROM Lead” leads = sf.query_all(query) df = pd.DataFrame(leads[‘records’]).drop(columns=[‘attributes’]) # Preprocess and split data df = pd.get_dummies(df, columns=[‘LeadSource’]) X = df.drop(‘Converted’, axis=1) y = df[‘Converted’] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Train model model = RandomForestClassifier(n_estimators=100, random_state=42) model.fit(X_train, y_train) # Evaluate accuracy accuracy = model.score(X_test, y_test) print(f”Model Accuracy: {accuracy * 100:.2f}%”) 7. Best Practices for Using Python with Salesforce To maximize the efficiency and security of Python with Salesforce: 8. Recommended Learning Resources By leveraging Python alongside Salesforce, organizations can automate tasks, integrate systems, and enhance their data analytics, all while boosting productivity. Content updated August 2024. Like Related Posts Salesforce OEM AppExchange Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more The Salesforce Story In Marc Benioff’s own words How did salesforce.com grow from a start up in a rented apartment into the world’s Read more Salesforce Jigsaw Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more Health Cloud Brings Healthcare Transformation Following swiftly after last week’s successful launch of Financial Services Cloud, Salesforce has announced the second installment in its series Read more

Read More
gettectonic.com