File size: 5,570 Bytes
4d364ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e79248f
 
0dd55fe
 
 
 
 
 
 
 
 
 
 
 
 
528dbe0
 
 
 
 
9ca9a00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56b7f13
 
9ca9a00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56b7f13
 
e79248f
 
 
 
 
 
 
 
 
 
 
528dbe0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
license: openrail
tags:
- framer
- overrides
- components
- custom
- code
- web
- motion
- animation
- design
- generator
- coding
- programming
---

## Model Details:
- **Model Name**: framer_overrides
- **Endpoint Name**: framer_custom_code
- **Endpoint ID**: 3736911268833918976
- **Base Model:** gemini-2.0-flash-lite-001
- **Tuning Method:** Supervised
- **Deployment Platform**: Google Cloud Vertex AI.
- **Region**: us-central1
- **API Endpoint**: fra
- **Infrastructure**: Google-managed.
- **Model Status**: Active
- **Original Model**: Gemini 2.5 pr
- 
## How to use:
**Install the Vertex AI SDK: Open a terminal window and enter the command below. You can also install it in a virtualenv**
```pip install --upgrade google-genaigcloud auth application-default login```

**Use the following code in your application to request a model response**
```from google import genai
from google.genai import types
import base64def
generate():  client = genai.Client(      vertexai=True,      project="903806786624",      location="us-central1",  )
  model = "projects/903806786624/locations/us-central1/endpoints/2455637174847012864"
  contents = [    types.Content(      role="user",      parts=[      ]    )  ]
  generate_content_config = types.GenerateContentConfig(
    temperature = 1,
    top_p = 0.95,
    max_output_tokens = 8192,
    safety_settings = [types.SafetySetting(
      category="HARM_CATEGORY_HATE_SPEECH",
      threshold="OFF"    ),
  types.SafetySetting(
      category="HARM_CATEGORY_DANGEROUS_CONTENT",
      threshold="OFF"
    ),types.SafetySettin
      category="HARM_CATEGORY_SEXUALLY_EXPLICIT"
      threshold="O
      ),types.SafetySetting(
      category="HARM_CATEGORY_HARASSMENT",
            threshold="OFF"
    )]
  )
```
**Ensure live Framer Docs are checked with function calling:** 
```import {
  FunctionCallingConfigMode,
  FunctionDeclaration,
  GoogleGenAI,
  Type,
  GenerateContentResponse,
} from '@google/genai';

// --- Configuration and Function Declaration ---

const API_KEY = process.env.API_KEY;

const getFramerUpdateInfoFunctionDeclaration: FunctionDeclaration = {
  name: 'getFramerUpdateInfo',
  description: `Retrieves update information or code examples from specific sections of the Framer developer documentation or the Motion animation library documentation.
This function helps to check for the latest information on Framer Components, Overrides, and the Motion animation library.
Relevant documentation sections include:
- Framer Components:
  - https://www.framer.com/developers/component-examples
  - https://www.framer.com/developers/auto-sizing
  - https://www.framer.com/developers/property-controls
  - https://www.framer.com/developers/components-reference
- Framer Overrides:
  - https://www.framer.com/developers/overrides-introduction
  - https://www.framer.com/developers/overrides-examples
- Motion Animation Library:
  - https://motion.dev/docs/
Use this function to find out about recent changes, validate against training data, or to get code snippets.`,
  parameters: {
    type: Type.OBJECT,
    properties: {
      documentationArea: {
        type: Type.STRING,
        description: "The primary area of documentation to query. Supported areas: 'Components', 'Overrides', 'Motion'.",
      },
      specificTopic: {
        type: Type.STRING,
        description: "Optional. A more specific topic or sub-section within the documentation area. Examples: 'auto-sizing', 'property-controls', 'overrides-introduction', 'animation types', 'component-examples'.",
      },
      query: {
        type: Type.STRING,
        description: "The specific question about updates, conflicts with training data, or the code example being sought. E.g., 'latest changes to property controls', 'example for tap gesture animation', 'any new override examples'.",
      },
    },
    required: ['documentationArea', 'query'],
  },
};


// --- The Core Function for Calling the AI ---

async function generateContentWithFunctions(prompt: string) {
  if (!API_KEY) {
    console.error('API_KEY is not configured. Please set the environment variable.');
    return;
  }
  
  try {
    const ai = new GoogleGenAI({ apiKey: API_KEY });

    const response: GenerateContentResponse = await ai.models.generateContent({
      model: 'projects/903806786624/locations/us-central1/endpoints/2455637174847012864',
      contents: [{role: "user", parts: [{text: prompt}]}],
      config: {
        tools: [
          { functionDeclarations: [getFramerUpdateInfoFunctionDeclaration] }
        ],
        toolConfig: {
          functionCallingConfig: {
            mode: FunctionCallingConfigMode.ANY,
            allowedFunctionNames: ['getFramerUpdateInfo'],
          },
        },
      },
    });
    
    // log response
    if (response.functionCalls && response.functionCalls.length > 0) {
      console.log('Function call(s) requested:');
      response.functionCalls.forEach(fc => {
        console.log(`Function: ${fc.name}\nArguments: ${JSON.stringify(fc.args, null, 2)}`);
      });
    } else if (response.text) {
        console.log(response.text);
    } else {
        console.log('Received a response, but it contained no text or function calls.');
    }

  } catch (e) {
    console.error(e);
  }
}
```

## Tuning Information:
- **Number of Epochs:** 25
- **Default Checkpoint:** 8
- **Learning Rate Multiplier:** 0.004
- **Adapter Size:** 4

## Performance and Status:
- **Status:** Succeeded
- **Region:** us-central1
- **Created:** June 10, 2025, 7:52:44 AM
- **Ended:** June 10, 2025, 8:09:47