To solve this optimization problem, we need to define the decision variables, objective function, and constraints. Let's break down the problem step by step:

1. Decision Variables:
   - Let \(x_A\) be the amount of Type A dog food purchased in kg.
   - Let \(x_B\) be the amount of Type B dog food purchased in kg.

2. Objective Function:
   - The objective is to minimize the total cost. Given that Type A food costs $2 per kg and Type B food costs $5 per kg, the total cost \(C\) can be represented as \(C = 2x_A + 5x_B\).

3. Constraints:
   - Minimum meat requirement: The mixture must contain at least 12 units of meat. Since Type A food contains 1 unit of meat per kg and Type B food contains 3 units of meat per kg, we have \(1x_A + 3x_B \geq 12\).
   - Minimum micronutrients requirement: The mixture must contain at least 8 units of micronutrients. Given that Type A food contains 2 units of micronutrients per kg and Type B food contains 1 unit of micronutrient per kg, we have \(2x_A + 1x_B \geq 8\).
   - Non-negativity constraints: Since the amount of dog food cannot be negative, we have \(x_A \geq 0\) and \(x_B \geq 0\).

Now, let's translate these into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Dog_Food_Optimization")

# Define the decision variables
x_A = m.addVar(vtype=GRB.CONTINUOUS, name="Type_A", lb=0)
x_B = m.addVar(vtype=GRB.CONTINUOUS, name="Type_B", lb=0)

# Set the objective function
m.setObjective(2*x_A + 5*x_B, GRB.MINIMIZE)

# Add constraints
m.addConstr(1*x_A + 3*x_B >= 12, "Meat_Requirement")
m.addConstr(2*x_A + 1*x_B >= 8, "Micronutrients_Requirement")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Type A dog food: {x_A.x} kg")
    print(f"Type B dog food: {x_B.x} kg")
    print(f"Total cost: ${m.objVal}")
else:
    print("No optimal solution found")
```